Linux Configuration - Ssmtp: Cannot Open Smtp.Gmail.Com:587

Linux configuration -- ssmtp: Cannot open smtp.gmail.com:587

I encountered the same problem. The following steps worked for me:

  1. sudo vi /etc/ssmtp/ssmtp.conf
    Add the following:

TLS_CA_FILE=/etc/pki/tls/certs/ca-bundle.crt
root=XXXX@gmail.com
mailhub=smtp.gmail.com:587
AuthUser=XXXX
AuthPass=XYXYX
UseSTARTTLS=Yes
UseTLS=Yes
hostname=AAAA

Replace:
XXXX- username(mail)
XYXYX- password(mail password)
AAAA- hostname(get by running $hostname)


  1. sudo vi /etc/ssmtp/revaliases
    Add the following:

root:XXXX@gmail.com:smtp.gmail.com:587

Replace :
XXXX - username(mail)


  1. Try running the mail now:

    $mail -s "adasdas" XXXX@gmail.com

    CC:
    XYZLoremIpsum
    .
    'ctrl+D'

It solved my problem.
Hopefully for a system(Office) you need to configure correct proxy settings otherwise you will get an error:

cannot send message: Process exited with a non-zero status

Cannot open smtp.gmail.com:587

I Solved it by changing hostname to localhost.

Unable to connect to mail.google.com on motion configuration

Your revaliases file should be pointing to smtp.gmail.com instead of mail.gmail.com. Please try with following in your revaliases file:

root:MyEmailAddress@gmail.com:smtp.gmail.com:587



Related Topics



Leave a reply



Submit