無法在 Ubuntu 14.10、Postfix 和 Dovecot 上傳送電子郵件

無法在 Ubuntu 14.10、Postfix 和 Dovecot 上傳送電子郵件

我在設定 Ubuntu 伺服器安裝來傳送/接收電子郵件時遇到問題。我對這一切都很陌生,所以如果我沒有提供足夠/正確的信息,我深表歉意。如果您還需要任何其他信息,請告訴我。我不知道下一步該做什麼。

我已經正確設定了伺服器並且已經透過 SSH 連接到它。


當我嘗試使用以下命令從命令列發送電子郵件時:

mmail [email protected]
Cc: [email protected]
Subject: Test
This is a test

我在我的中得到以下內容/var/log/mail.log

Nov 29 23:13:44 mikeserver postfix/pickup[24226]: 0A60F63E007E: uid=1000 from=<mike@mikeserver>
Nov 29 23:13:44 mikeserver postfix/cleanup[26218]: 0A60F63E007E: message-id=<20141129231344.0A60F63E007E@mikeserver>
Nov 29 23:13:44 mikeserver postfix/qmgr[24227]: 0A60F63E007E: from=<mike@mikeserver>, size=381, nrcpt=2 (queue active)
Nov 29 23:13:45 mikeserver postfix/smtp[25920]: 0A60F63E007E: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[173.194.67.27]:25, delay=1.8, delays=0.08/0/1.3/0.46, dsn=2.0.0, status=sent (250 2.0.0 OK 1417302826 q5si38702680wia.0 - gsmtp)
Nov 29 23:13:48 mikeserver postfix/smtp[26219]: 0A60F63E007E: to=<[email protected]>, relay=mail.example.com[111.222.333.444]:25, delay=4.9, delays=0.08/0.01/4.3/0.5, dsn=5.0.0, status=bounced (host mail.exampleid: 550-Verification failed for <mike@mikeserver> 550-The mail server could not deliver mail to mike@mikeserver.  The account or domain may not exist, they may be blacklisted, or missing the proper dns entries. 550 Sender verify failed (in reply to RCPT TO command))
Nov 29 23:13:49 mikeserver postfix/cleanup[26218]: 46C4163E007F: message-id=<20141129231349.46C4163E007F@mikeserver>
Nov 29 23:13:49 mikeserver postfix/bounce[26225]: 0A60F63E007E: sender non-delivery notification: 46C4163E007F
Nov 29 23:13:49 mikeserver postfix/qmgr[24227]: 46C4163E007F: from=<>, size=2631, nrcpt=1 (queue active)
Nov 29 23:13:49 mikeserver postfix/qmgr[24227]: 0A60F63E007E: removed
Nov 29 23:13:49 mikeserver postfix/local[26226]: 46C4163E007F: to=<mike@mikeserver>, relay=local, delay=0.15, delays=0.08/0.02/0/0.05, dsn=2.0.0, status=sent (delivered to maildir)
Nov 29 23:13:49 mikeserver postfix/qmgr[24227]: 46C4163E007F: removed

我也在我的電腦上收到此訊息OS X Mac 郵件用戶端

This is the mail system at host mikeserver.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                  The mail system

<[email protected]>: host mail.example.com[111.222.333.444] said:
   550-Verification failed for <mike@mikeserver> 550-The mail server could not
   deliver mail to mike@mikeserver.  The account or domain may not exist, they
   may be blacklisted, or missing the proper dns entries. 550 Sender verify
   failed (in reply to RCPT TO command)
Reporting-MTA: dns; mikeserver
X-Postfix-Queue-ID: 8038563E007C
X-Postfix-Sender: rfc822; mike@mikeserver
Arrival-Date: Sat, 29 Nov 2014 22:47:58 +0000 (GMT)

Final-Recipient: rfc822; [email protected]
Action: failed
Status: 5.0.0
Remote-MTA: dns; mail.example.com
Diagnostic-Code: smtp; 550-Verification failed for <mike@mikeserver> 550-The
   mail server could not deliver mail to mike@mikeserver.  The account or
   domain may not exist, they may be blacklisted, or missing the proper dns
   entries. 550 Sender verify failed

當我嘗試從伺服器發送電子郵件到任何地址時,我收到以下返回訊息

Transcript of session follows.

Out: 220 mikeserver ESMTP Postfix (Ubuntu)
In:  EHLO [192.168.0.12]
Out: 250-mikeserver
Out: 250-PIPELINING
Out: 250-SIZE 10240000
Out: 250-VRFY
Out: 250-ETRN
Out: 250-STARTTLS
Out: 250-ENHANCEDSTATUSCODES
Out: 250-8BITMIME
Out: 250 DSN
In:  STARTTLS
Out: 220 2.0.0 Ready to start TLS
In:  EHLO [192.168.0.12]
Out: 250-mikeserver
Out: 250-PIPELINING
Out: 250-SIZE 10240000
Out: 250-VRFY
Out: 250-ETRN
Out: 250-AUTH PLAIN
Out: 250-AUTH=PLAIN
Out: 250-ENHANCEDSTATUSCODES
Out: 250-8BITMIME
Out: 250 DSN
In:  AUTH PLAIN bWlrZQBtaWtlAHBhc3N3b3Jk
Out: 235 2.7.0 Authentication successful
In:  MAIL FROM:<mike@mikeserver>
Out: 250 2.1.0 Ok
In:  RCPT TO:<[email protected]>
Out: 451 4.3.5 Server configuration error
In:  RCPT TO:<[email protected]>
Out: 451 4.3.5 Server configuration error
In:  QUIT
Out: 221 2.0.0 Bye

但是 OS X Mac Mail Connection Doctor 可以正常連接到伺服器的 IMAP 和 SMTP

OS X Mac 郵件連線醫生

從 OS X 終端運行lab_release -a會給出以下結果。

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.10
Release:    14.10
Codename:   utopic

非常感謝任何信息。我已經在這上面待了好幾個小時了。即使只是為了讓我提供更多資訊。我不知道下一步該看哪裡。

答案1

您正在將來自 mike@mikeserver 的郵件傳送到外部網域。此網域檢查發送郵件的位址是否存在(反垃圾郵件原則)。 mike@mikeserver 不是網路上的現有名稱,因此郵件被退回(寄件者驗證失敗)。

在這種情況下,只需將您的發送地址調整到現有的網域可能會對您有所幫助。然而,許多伺服器也會檢查您的反向 dns 以符合您的 HELO/EHLO,因此您的識別碼應該與您的反向 dns 相同,以便大多數網域能夠向其發送郵件。

答案2

您正在嘗試從 mikeserver 發送,但這不是一個 FQDN。您應該使用郵件中繼從您的家用電腦發送郵件。如果它是具有靜態 IP 的伺服器,您必須檢查 dns 名稱解析是否向前和向後工作、您的 mx 記錄設定是否正確 (mikeserver.yourdomain.tld) 以及伺服器的郵件名稱是否相應設定。您的伺服器也應該有有效的 spf 記錄。

相關內容