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!
Best Answer
I think I solved my problem by
So, sending a test mail with this command worked
Don't forget to send the final mail by hitting [ctrl] + [d]