0

I have set up an linux webserver on my raspberry pi and now want the server be able to send emails without configuring a complete mailserver.

Thats why I have chosen the MTA 'sendmail', which I'm trying to configure correctly for days now.

In my /etc/mail/sendmail.mc I have added these lines:

define(`SMART_HOST',`[smtp.strato.de]')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 465')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 465')dnl
define(`confAUTH_OPTIONS', `A p')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo/auth.db')dnl

In my hashed /etc/mail/authinfo/auth I have

AuthInfo: "U:root" "I:me@mydomain.com" "P:mypassword"

But sending a test email like this

echo "Just testing my sendmail relay" | mail -s "Sendmail Relay" somerecipient@email.com

doesn't give me any errors but still never arrived the recipient.

Let's check my /var/log/mail.log

Mar 30 14:35:02 localhost sm-mta[2375]: v2UCKHOT002349: to=<somerecipient@email.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:14:45, xdelay=00:02:00, mailer=relay, pri=300405, relay=smtp.strato.de. [81.169.145.133], dsn=4.0.0, stat=Deferred: Connection reset by smtp.strato.de.
Mar 30 14:35:02 localhost sm-mta[2375]: v2UAPG9t014829: to=<somerecipient@email.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=02:09:46, xdelay=00:00:00, mailer=relay, pri=1380405, relay=smtp.strato.de., dsn=4.0.0, stat=Deferred: Connection reset by smtp.strato.de.
Mar 30 14:35:02 localhost sm-mta[2375]: v2UAHJSs014703: to=<somerecipient@email.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=02:17:43, xdelay=00:00:00, mailer=relay, pri=1470405, relay=smtp.strato.de., dsn=4.0.0, stat=Deferred: Connection reset by smtp.strato.de.

What does stat=Deferred: Connection reset by smtp.strato.de. mean?

What can I do to finally solve my sending-email-problem?

I'm thankful for any hint!

pixelmusic
  • 111
  • 1
  • 6
  • Hard to say; can you set `O LogLevel=25` in `sendmail.cf`restart `sendmail` and then run the queue again with `sendmail -q` ? – thrig Mar 30 '17 at 14:37
  • If you don't want to set up a complete mail server, sendmail is most certainly not the right choice for you. – Jenny D Apr 03 '17 at 12:03

3 Answers3

1

I think I solved my problem by

  1. Using port 587 instead of 465, thanks to the hint of Andrzej
  2. Specifying the sender mail, because my hoster strato was denying mails that are not authenticated (in my case root@localhost.localdomain)

So, sending a test mail with this command worked

mail -s "Some random subject" -a "From: me@mydomain.com" somerecipient@email.com

Don't forget to send the final mail by hitting [ctrl] + [d]

pixelmusic
  • 111
  • 1
  • 6
0

Use port 587 (msa) instead of port 465 (smtps).

smtp.strato.de seems to support both.

AnFi
  • 5,883
  • 1
  • 12
  • 26
0

In regards to your literal question "Connection reset by smtp.strato.de." means the remote server closed the TCP connection before it was able to send the message, usually without sending an error code or goodbye message.

Andrew Domaszek
  • 5,103
  • 1
  • 14
  • 26