我已经在我的树莓派上build立了一个Linuxnetworking服务器,现在希望服务器能够发送邮件而不需要configuration一个完整的邮件服务器。
这就是为什么我select了MTA'sendmail',我正在尝试正确configuration好几天。
在我的/etc/mail/sendmail.mc我已经添加了这些行:
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
在我的哈希/etc/mail/authinfo/auth我有
AuthInfo: "U:root" "I:[email protected]" "P:mypassword"
但发送这样的testing电子邮件
echo "Just testing my sendmail relay" | mail -s "Sendmail Relay" [email protected]
不给我任何错误,但仍然没有到达收件人。
我们来看看我的/var/log/mail.log
Mar 30 14:35:02 localhost sm-mta[2375]: v2UCKHOT002349: to=<[email protected]>, ctladdr=<[email protected]> (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=<[email protected]>, ctladdr=<[email protected]> (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=<[email protected]>, ctladdr=<[email protected]> (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.
什么是stat=Deferred: Connection reset by smtp.strato.de. 意思?
我能做些什么来最终解决我的发送电子邮件问题?
我很感激任何提示!
我想我通过解决了我的问题
所以,用这个命令发送一个testing邮件的工作
mail -s "Some random subject" -a "From: [email protected]" [email protected]
不要忘记通过点击[ctrl] + [d]来发送最终邮件
使用端口587(msa)而不是端口465(smtps)。
smtp.strato.de似乎支持两者。
关于你的字面问题“通过smtp.strato.de重置连接”。 意味着远程服务器在能够发送消息之前closuresTCP连接,通常不发送错误代码或再见消息。