Linux configuration - ssmtp: Cannot open smtp.gmail.comโˆ—87

Hi, I have RHEL5 with ssmtp installed ssmtp-2.61-22.el5.i386.rpm

my / etc / ssmtp / ssmtp.conf is updated as shown below: -

AuthUser=mymail@gmail.com AuthPass=mypassword FromLineOverride=YES mailhub=smtp.gmail.com:587 UseSTARTTLS=YES UseTLS=Yes RewriteDomain=gmail.com 

also updated as below:

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

My sendmail service is disabled

when i try to send an email using ssmtp i get below error

 [ root@ctmtest ssmtp]# echo "test" | ssmtp -vvv mymail@gmail.com [<-] 220 smtp.gmail.com ESMTP v26sm42795996pfi.56 - gsmtp [->] EHLO ctmtest [<-] 250 SMTPUTF8 [->] STARTTLS [<-] 220 2.0.0 Ready to start TLS ssmtp: Cannot open smtp.gmail.com:587 

I searched a lot of tags with this error but could not fix it

my system can connect smtp.gmail.com on port 587

 [ root@ctmtest ssmtp]# telnet smtp.gmail.com 587 Trying 74.125.200.108... Connected to smtp.gmail.com (74.125.200.108). Escape character is '^]'. 220 smtp.gmail.com ESMTP o90sm11695907pfi.17 - gsmtp 

Is there anyone who fixed this? please suggest

+5
source share
4 answers

try changing this option

Giving less secure apps access to your account

https://support.google.com/accounts/answer/6010255?hl=en

+2
source

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

  • 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- host name (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 to start mail now:

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

    CC: XYZLoremIpsum, 'CTRL + D'

He solved my problem. We hope that for the system (Office) you need to configure the correct proxy server settings, otherwise you will receive an error message:

cannot send message: process terminated with non-zero status

+2
source

Perhaps this is due to the fact that you are not setting the hostname ssmtp.conf parameter. This must be a resolvable, fully qualified domain name; yours defaults to the ctmtest machine ctmtest (as shown in the EHLO above).

The question of what user963 mentions in his answer may also apply here, but in this case you will get another error message, something like ssmtp: Authorization failed (534 5.7.14 ...) .

+1
source

first, to get your host type in terminal: hostname

copy it and run in the hostname parameter in ssmtp.conf

+1
source

Source: https://habr.com/ru/post/1241993/


All Articles