a:我的本地pc,localhost.localdomain
b是我的vps,它构build了postfix
c是我的雅虎帐户。
loginb(我的vps)。
echo "test"|mail -s "test" [email protected]
该电子邮件可以发送到[email protected]
我的后缀上的所有configuration。
postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix mydomain = domain.com myhostname = mail.domain.com myorigin = $mydomain mynetworks = 127.0.0.0/8 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop unknown_local_recipient_reject_code = 550
现在我想从(我的本地PC)b(我的vps)上调用postfix发送电子邮件到雅虎帐户。
msmtp安装在b(我的本地电脑)上。
cat .msmtprc account default host domain.com user root from [email protected] password xxxxxx auth login tls off logfile .msmtp.log
发送电子邮件
echo "test" | mail -s "test" [email protected]
这里是我的本地电脑上的日志。
cat /var/log/mail.log Oct 7 08:09:50 localhost postfix/pickup[23565]: D6FA3482226: uid=1000 from=<root> Oct 7 08:09:50 localhost postfix/cleanup[25879]: D6FA3482226: message-id=<[email protected]> Oct 7 08:09:50 localhost postfix/qmgr[4739]: D6FA3482226: from=<[email protected]>, size=359, nrcpt=1 (queue active) Oct 7 08:09:55 localhost postfix/smtp[25881]: D6FA3482226: to=<[email protected]>, relay=mta5.am0.yahoodns.net[98.136.216.26]:25, delay=4.3, delays=0.08/0/2.5/1.8, dsn=2.0.0, status=sent (250 ok dirdel) Oct 7 08:09:55 localhost postfix/cleanup[25879]: 38BC7482228: message-id=<[email protected]> Oct 7 08:09:55 localhost postfix/bounce[26007]: D6FA3482226: sender delivery status notification: 38BC7482228 Oct 7 08:09:55 localhost postfix/qmgr[4739]: 38BC7482228: from=<>, size=1988, nrcpt=1 (queue active) Oct 7 08:09:55 localhost postfix/qmgr[4739]: D6FA3482226: removed Oct 7 08:09:55 localhost postfix/smtp[26008]: 38BC7482228: to=<[email protected]>, relay=none, delay=0.05, delays=0.03/0.01/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=localdomain.localdomain type=AAAA: Host not found) Oct 7 08:09:55 localhost postfix/qmgr[4739]: 38BC7482228: removed
我可以在B(我的VPS)发送电子邮件到雅虎帐户,为什么不能从本地电脑发送电子邮件到B(我的VPS)的后缀调用到雅虎帐户?
如何解决它?
a :my local pc, localhost.localdomain
这是确切的问题。 雅虎将不会接收来自[email protected]的邮件。 简而言之,即使在垃圾邮件中也不会find它。 如果发送主机是这样的,他们只是放下你的邮件。我过去经历过这个。
dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=localdomain.localdomain type=AAAA: Host not found)
检查信封发件人的域名是一个非常普遍的方法来打击垃圾邮件。 这不仅是雅虎,但每一个合理的邮件configuration这样做, 只能本地交付这种本地主机名称可以被允许。
使用@localhost.localdomain可能是由于误解您的本地计算机没有任何域而导致的,因此不允许使用任何域作为发件人地址。 这不是真的。 欺骗您允许使用的电子邮件地址根本不是欺骗性的 – 电子邮件的devise方式是每个地址在技术上都是欺骗性的,只有更高级的方法(SPF,DKIM,DMARC)可以帮助判断使用是否合法。
如果您的VPS信任您的本地计算机(或者是因为它是受信任的IP,或者连接已通过身份validation),并且您的域名的SPFlogging中列出了VPS,则可以在本地信封发件人和From:机。