我面临着发送电子邮件的问题。 我已经成功设置了dovecot + postfix + mysql。问题是当我从localhost发送电子邮件时(例如来自php脚本),电子邮件不在INBOX中。当我从任何其他服务器发送电子邮件时,它完美地工作。我不知道是什么原因导致了这个问题。 Maillog似乎没问题。我应该去哪儿看看?
记录未送达的电子邮件,如下所示
Nov 9 22:31:31 user postfix/pickup[15929]: 474A5300E47: uid=5005 from=<webmaster@domain.com>
Nov 9 22:31:31 user postfix/cleanup[18511]: 474A5300E47: message-id=<20141109223131.474A5300E47@domain.com>
Nov 9 22:31:31 user postfix/qmgr[2582]: 474A5300E47: from=<webmaster@domain.com>, size=1198, nrcpt=1 (queue active)
Nov 9 22:31:35 user postfix/smtpd[18515]: connect from localhost[127.0.0.1]
Nov 9 22:31:35 user postfix/smtpd[18515]: 9A538300E48: client=localhost[127.0.0.1]
Nov 9 22:31:35 user postfix/cleanup[18511]: 9A538300E48: message-id=<20141109223131.474A5300E47@domain.com>
Nov 9 22:31:35 user postfix/smtpd[18515]: disconnect from localhost[127.0.0.1]
Nov 9 22:31:35 user postfix/qmgr[2582]: 9A538300E48: from=<webmaster@domain.com>, size=1595, nrcpt=1 (queue active)
Nov 9 22:31:35 user amavis[3458]: (03458-10) Passed CLEAN {RelayedInbound}, <webmaster@domain.com> -> <info@domain.com>, Message-ID: <20141109223131.474A5300E47@domain.com>, mail_id: 1S0boeHaaI2L, Hits: 1.115, size: 1196, queued_as: 9A538300E48, 4313 ms
Nov 9 22:31:35 user postfix/smtp[18512]: 474A5300E47: to=<info@domain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=4.4, delays=0.05/0.02/0.02/4.3, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 9A538300E48)
Nov 9 22:31:35 user postfix/qmgr[2582]: 474A5300E47: removed
Nov 9 22:31:35 user dovecot: lda(info@domain.com): sieve: msgid=<20141109223131.474A5300E47@domain.com>: stored mail into mailbox 'INBOX'
Nov 9 22:31:35 user postfix/pipe[18516]: 9A538300E48: to=<info@domain.com>, relay=dovecot, delay=0.1, delays=0.02/0.03/0/0.05, dsn=2.0.0, status=sent (delivered via dovecot service)
Nov 9 22:31:35 user postfix/qmgr[2582]: 9A538300E48: removed
记录已发送的电子邮件
Nov 9 22:32:13 user postfix/smtpd[18542]: connect from mail-wi0-x236.google.com[2a00:1450:400c:c05::236]
Nov 9 22:32:13 user postfix/smtpd[18542]: 985EB300E47: client=mail-wi0-x236.google.com[2a00:1450:400c:c05::236]
Nov 9 22:32:13 user postfix/cleanup[18511]: 985EB300E47: message-id=<B840B0EE-45E6-4609-BD14-59EBF39449D0@gmail.com>
Nov 9 22:32:13 user postfix/qmgr[2582]: 985EB300E47: from=<example@gmail.com>, size=7916, nrcpt=1 (queue active)
Nov 9 22:32:13 user postfix/smtpd[18542]: disconnect from mail-wi0-x236.google.com[2a00:1450:400c:c05::236]
Nov 9 22:32:18 user postfix/smtpd[18515]: connect from localhost[127.0.0.1]
Nov 9 22:32:18 user postfix/smtpd[18515]: 3F751300E48: client=localhost[127.0.0.1]
Nov 9 22:32:18 user postfix/cleanup[18511]: 3F751300E48: message-id=<B840B0EE-45E6-4609-BD14-59EBF39449D0@gmail.com>
Nov 9 22:32:18 user postfix/qmgr[2582]: 3F751300E48: from=<example@gmail.com>, size=8407, nrcpt=1 (queue active)
Nov 9 22:32:18 user postfix/smtpd[18515]: disconnect from localhost[127.0.0.1]
Nov 9 22:32:18 user amavis[2072]: (02072-11) Passed CLEAN {RelayedInbound}, [2a00:1450:400c:c05::236]:65181 [86.149.90.56] <example@gmail.com> -> <info@domain.com>, Queue-ID: 985EB300E47, Message-ID: <B840B0EE-45E6-4609-BD14-59EBF39449D0@gmail.com>, mail_id: IXFd3XMT3ftY, Hits: -0.799, size: 7915, queued_as: 3F751300E48, dkim_sd=20120113:gmail.com, 4569 ms
Nov 9 22:32:18 user postfix/smtp[18512]: 985EB300E47: to=<info@domain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=4.7, delays=0.1/0/0.02/4.6, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 3F751300E48)
Nov 9 22:32:18 user postfix/qmgr[2582]: 985EB300E47: removed
Nov 9 22:32:18 user dovecot: lda(info@domain.com): sieve: msgid=<B840B0EE-45E6-4609-BD14-59EBF39449D0@gmail.com>: stored mail into mailbox 'INBOX'
Nov 9 22:32:18 user postfix/pipe[18516]: 3F751300E48: to=<info@domain.com>, relay=dovecot, delay=0.05, delays=0.01/0/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)
Nov 9 22:32:18 user postfix/qmgr[2582]: 3F751300E48: removed
答案 0 :(得分:0)
固定IT
以防其他人会遇到这个问题。检查/ etc / hosts文件 如果你有
39.29.192.294 domain.com
当然使用您的公共IP地址&amp;你的域名。
它不会将从localhost发送的任何电子邮件发送到@ domain.com。删除此行&amp;它应该工作;)