4

I just installed sendmail on my linux os.

I can't seem to receive emails, this is what I see in logs:

    Aug 10 14:12:10 localhost sendmail[13316]: v7A9CAPC013316: from=root, size=238, class=0, nrcpts=1, msgid=<201708100912.v7A9CAPC013316@localhost.test>, relay=root@localhost
Aug 10 14:12:10 localhost sendmail[13317]: v7A9CAwD013317: from=<root@localhost.test>, size=484, class=0, nrcpts=1, msgid=<201708100912.v7A9CAPC013316@localhost.test>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Aug 10 14:12:10 localhost sendmail[13316]: v7A9CAPC013316: to=sandeelo.danyal@gmail.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30238, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v7A9CAwD013317 Message accepted for delivery)
Aug 10 14:12:12 localhost sendmail[13319]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128
Aug 10 14:12:13 localhost sendmail[13319]: v7A9CAwD013317: to=<sandeelo.danyal@gmail.com>, ctladdr=<root@localhost.test> (0/0), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120484, relay=gmail-smtp-in.l.google.com. [74.125.133.26], dsn=5.0.0, stat=Service unavailable
Aug 10 14:12:13 localhost sendmail[13319]: v7A9CAwD013317: v7A9CDwD013319: DSN: Service unavailable
Aug 10 14:12:13 localhost sendmail[13319]: v7A9CDwD013319: to=<root@localhost.test>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31714, dsn=2.0.0, stat=Sent
AnFi
  • 10,493
  • 3
  • 23
  • 47
Danyal Sandeelo
  • 12,196
  • 10
  • 47
  • 78
  • You question seem to be fit for stackoverflow site. Your sendmail seems to be unable to deliver/pass messages to gmail.com. Could you include bounce email received by the sender? – AnFi Aug 10 '17 at 10:45

1 Answers1

13
  1. Fix sender domain name (from=<root@localhost.test> => localhost.test)
    Change name (FQDN) of the host to name with valid MX/A records
  2. As root use the script below to get full transcript of SMTP session.
    It should give you a better idea what is disliked by gmail.

test script (for use by root):

#!/bin/sh
TO=somebody@gmail.com

# -i  - do not treat special lines starting with "."
# -v  - use verbose mode (provide SMTP session transcript)
# -Am - use sendmail.cf (do not send via localhost:25) - requires root privileges
/usr/sbin/sendmail -i -v -Am -- $TO <<END
Subject: Delivery test
To: $TO

Delivery test.
END
AnFi
  • 10,493
  • 3
  • 23
  • 47
  • 1
    In my case I discovered a typo in my username, very helpful script. – Dr. Mian Jul 25 '19 at 18:56
  • After configuration, the above script send an email but this one not. `echo "Subject: sendmail test" | sendmail -v somebody@gmaill.com` I end up getting `STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message.` Any idea? – Dr. Mian Jul 25 '19 at 20:30
  • The reason is probably that I am overwriting mian@localhost.localdomain in sendmail with a proper email, which is taking effect in your script but not in my script. – Dr. Mian Jul 25 '19 at 20:33
  • This one work `echo "Subject: sendmail test" | sendmail -i -v -Am mianasbat@gmail.com`. Something fishy in -i and -Am. – Dr. Mian Jul 25 '19 at 20:35
  • After I used AnFi's script, I was able to see that my "DSN: Service unavailable" was actually "535-5.7.8 Username and Password not accepted." in the detail log. My solution was to allow less secure apps in my gmail account settings. I was using smtp.gmail.com via relay. Thank you very much for the script. – user3139574 Oct 25 '19 at 11:18