-3

I have been following a how to for setting up sendmail using a smart host ssrs.reachmail.net, However I cant seem to successfully send a email from my server to my gmail account.

I think I'm misunderstanding some things, Where to go from here ? Do I need to create a email server to use the email sender email root@example.duckdns.org ? I assumed this is what sendmail did ?

Below is a test email

root@example:/etc/mail/auth# sendmail -Am -v -t
to: example@gmail.com
From: example@gmail.com
Subject: Test
Test

example@gmail.com... Connecting to ssrs.reachmail.net. port 587 via relay...
220 ssrs.reachmail.net rmsmtp 3.1.0a c8a9c89b7f
>>> EHLO example.duckdns.org
250-EASYSMTP
250-8BITMIME
250-SIZE 102400000
250-AUTH PLAIN LOGIN
250 STARTTLS
>>> STARTTLS
220 go ahead
>>> EHLO example.duckdns.org
250-EASYSMTP
250-8BITMIME
250-SIZE 102400000
250-AUTH PLAIN LOGIN
250 STARTTLS
>>> MAIL From:<root@example.duckdns.org> SIZE=70
503 error: not authorized, use AUTH
root... Connecting to local...
root... Sent
Closing connection to ssrs.reachmail.net.
>>> QUIT
221 bye

This is in /var/log/mail.log

Mar  1 22:25:35 example sendmail[4733]: t226OaIL004733: from=root, size=70, class=0, nrcpts=1, msgid=<201503020624.t226OaIL004733@example.duckdns.org>, relay=root@localhost
Mar  1 22:25:36 example sendmail[4733]: STARTTLS=client, relay=ssrs.reachmail.net., version=TLSv1/SSLv3, verify=FAIL, cipher=AES256-SHA, bits=256/256
Mar  1 22:25:36 example sendmail[4733]: t226OaIL004733: to=example@gmail.com, ctladdr=pi (1000/1000), delay=00:01:00, xdelay=00:00:01, mailer=relay, pri=30070, relay=ssrs.reachmail.net. [66.251.253.157], dsn=5.0.0, stat=Service unavailable
Mar  1 22:25:36 example sendmail[4733]: t226OaIL004733: t226OaIM004733: DSN: Service unavailable
Mar  1 22:25:36 example sendmail[4733]: t226OaIM004733: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent
rreeves
  • 171
  • 2
  • 11

1 Answers1

2

The problem is that your SMART_HOST doesn't trust your server to send mail from an arbitrary sender to an arbitrary recipient, and thinks you're a common-or-garden relayer, so denies you.

Either you control ssrs.reachmail.net, in which case you need to tell it that your server is authorized to send mail by listing its IP address in (eg) /etc/mail/access and remaking the DB files. Or you don't control it, in which case you need to tell your server's sendmail that it should do what the error message says and use SMTP AUTH to authenticate itself to ssrs.reachmail.net before trying to relay mail off it.

MadHatter
  • 78,442
  • 20
  • 178
  • 229