我可以使用https://wiki.debian.org/GmailAndExim4,通过Debian Stretch使用GMail发送电子邮件。 当我发送电子邮件到root或user1它的作品:
echo root | mail root echo user1 | mail user1
但是,如果我尝试发送电子邮件给user1@hostname则电子邮件确实会发送,但是我也会收到来自Google的第二封电子邮件,内容是“找不到地址”。
这是/etc/aliases的摘录:
# /etc/aliases mailer-daemon: postmaster postmaster: root nobody: root hostmaster: root usenet: root news: root webmaster: root www: root ftp: root abuse: root noc: root security: root root: user1 user1: my_email@gmail.com
这是/etc/email-addresses :
# This is /etc/email-addresses. It is part of the exim package # # This file contains email addresses to use for outgoing mail. Any local # part not in here will be qualified by the system domain as normal. # # It should contain lines of the form: # #user: [email protected] user1: [email protected]
它看起来像cron试图发送电子邮件给user1@hostname这是我如何注意到错误。
如果我发送一封电子邮件给user1@hostname如echo test | mail user1@hostname echo test | mail user1@hostname我在GMail中收到两封电子邮件。 一个是我发送的电子邮件,另一个是来自[email protected]的邮件, [email protected]写着“找不到地址”。 这是我得到的完整电子邮件:
The response was: DNS Error: 42317832 DNS type 'mx' lookup of hostname responded with code NXDOMAIN Domain name not found: hostname Final-Recipient: rfc822; user1@hostname Action: failed Status: 4.0.0 Diagnostic-Code: smtp; DNS Error: 42317832 DNS type 'mx' lookup of hostname responded with code NXDOMAIN Domain name not found: hostname Last-Attempt-Date: Sat, 22 Jul 2017 21:49:10 -0700 (PDT) ---------- Forwarded message ---------- From: [email protected] To: <user1@hostname> Cc: Bcc: Date: Sun, 23 Jul 2017 00:49:09 -0400 Subject: user1@hostname