Linux – Sendmail and Gmail

emailgmaillinuxsendmailsmtp

I'm trying to send email with sendmail. I followed this how-to: http://linuxconfig.org/configuring-gmail-as-sendmail-email-relay

I tried to send the email over console:

echo "Just testing my sendmail gmail relay" | mail -v -s "Sendmail gmail Relay - New Server" user@gmailcom

The output of command is:

WARNING: local host name (server01) is not qualified; see cf/README: WHO AM I?
user@gmail.com... Connecting to [127.0.0.1] via relay...
220 server01 ESMTP Sendmail 8.14.4/8.14.4; Thu, 10 Dec 2015 18:05:36 -0200
>>> EHLO server01
250-server01 Hello server1 [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<root@server01> SIZE=279
250 2.1.0 <root@server01>... Sender ok
>>> RCPT To:<user@gmail.com>
>>> DATA
250 2.1.5 <user@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 tBAK5aGc015664 Message accepted for delivery
user@gmail.com... Sent (tBAK5aGc015664 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT

221 2.0.0 server01 closing connection
But the e-mail never arrives. Can you guys help me?

Logs:

Dec 10 19:03:31 server01 sendmail[16310]: tBAL3Uua016310: from=root, size=279, class=0, nrcpts=1, msgid=<201512102103.tBAL3Uua016310@server01>, relay=root@localhost
Dec 10 19:03:31 server01 sendmail[16311]: tBAL3VCu016311: from=<root@server01>, size=524, class=0, nrcpts=1, msgid=<201512102103.tBAL3Uua016310@server01>, proto=ESMTP, daemon=MTA, relay=corp-poa-pabx1 [127.0.0.1]
Dec 10 19:03:31 server01 sendmail[16310]: tBAL3Uua016310: to=user@gmail.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30279, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (tBAL3VCu016311 Message accepted for delivery)
Dec 10 19:03:32 server01 sendmail[16313]: STARTTLS=client, relay=gmail-smtp-msa.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128
Dec 10 19:03:33 server01 sendmail[16313]: tBAL3VCu016311: to=<user@gmail.com>, ctladdr=<root@server01> (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=120524, relay=gmail-smtp-msa.l.google.com. [64.233.190.108], dsn=5.0.0, stat=Service unavailable
Dec 10 19:03:33 server01 sendmail[16313]: tBAL3VCu016311: tBAL3XCu016313: DSN: Service unavailable
Dec 10 19:03:33 server01 sendmail[16313]: tBAL3XCu016313: to=<root@server01>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31757, dsn=2.0.0, stat=Sent

Thanks in advance..

Best Answer

Sendmail - debugging outgoing SMTP session

Gmail refused to accept your email.

Dec 10 19:03:33 server01 sendmail[16313]: tBAL3VCu016311: to=user@gmail.com, ctladdr=root@server01 (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=120524, relay=gmail-smtp-msa.l.google.com. [64.233.190.108], dsn=5.0.0, stat=Service unavailable

As root execute the command below to send a test message in verbose mode
(you will see SMTP session transcript):

(echo Subject: test; echo; echo test)|/usr/sbin/sendmail -Am -i -v user@gmail.com

You may add -d60.5 to sendmail command line options (before recipient address) to trace map/database lookups including authinfo lookups (search for passwords for SMTP AUTH).

Related Topic