Postfix 不需要對本機電子郵件進行身份驗證嗎?

Postfix 不需要對本機電子郵件進行身份驗證嗎?

我有一個 Postfix/Courier 郵件伺服器(透過 SASL/MySQL 驗證),全部都按照本教程。我目前在 Debian 6 上運行我的伺服器,它是一個 VPS。據我所知,它運作良好,但我似乎不需要對入站電子郵件發送進行身份驗證。如果我在停用 SMTP 驗證的情況下從 Outlook 向自己發送一封電子郵件,一切都會發生並且我不會被拒絕,伺服器上的日誌會告訴我:

Dec 19 09:39:33 new postfix/smtpd[20439]: connect from unknown[****]
Dec 19 09:39:33 new postfix/smtpd[20439]: 7FF1E469840: client=unknown[****]
Dec 19 09:39:33 new postfix/cleanup[20444]: 7FF1E469840: message-id=<000c01cefc31$41319a90$c394cfb0$@email@mydomain>
Dec 19 09:39:33 new postfix/qmgr[20429]: 7FF1E469840: from=<email@mydomain>, size=2730, nrcpt=1 (queue active)
Dec 19 09:39:33 new postfix/virtual[20445]: 7FF1E469840: to=<email@mydomain>, relay=virtual, delay=0.49, delays=0.4/0.08/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
Dec 19 09:39:33 new postfix/qmgr[20429]: 7FF1E469840: removed
Dec 19 09:39:36 new postfix/smtpd[20439]: disconnect from unknown[****]

****表示郵件客戶端的IP位址

但是,如果我嘗試將電子郵件傳送到外部網域(例如 Gmail 位址),則該電子郵件將按預期被拒絕並退回:

Your message did not reach some or all of the intended recipients.

  Subject:  
  Sent: 19/12/2013 9:49 a.m.

The following recipient(s) cannot be reached:

  '[email protected]' on 19/12/2013 9:49 a.m.
        Server error: '554 5.7.1 <[email protected]>: Relay access denied'

日誌還顯示了一些有關拒絕身份驗證的內容(這是預期的)

Dec 19 09:48:34 new postfix/smtpd[20449]: connect from unknown[****]
Dec 19 09:48:34 new postfix/smtpd[20449]: NOQUEUE: reject: RCPT from unknown[****]: 554 5.7.1 <[email protected]>: Relay access denied; from=<email@mydomain> to=<[email protected]> proto=ESMTP helo=<MyPC>
Dec 19 09:48:36 new postfix/smtpd[20449]: disconnect from unknown[****]

如果我在電子郵件用戶端 (Outlook) 上啟用 SMTP 驗證,一切都會如預期進行。實際上是否正在進行一些我沒有看到的身份驗證,或者這是否充當內部電子郵件的開放中繼?如果是這種情況,如何強制對所有電子郵件進行身份驗證?

我的 main.cf 是:

relayhost = 
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_protocols = all
broken_sasl_auth_clients = yes
virtual_alias_domains = 
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps

答案1

您的伺服器不是開放中繼。它設定為允許三種不同類型的郵件:

  1. 網路上任何人的郵件您自己的網域內的地址
  2. 源自您自己的郵件伺服器的郵件(例如 cron 作業的通知等),發送給網路上的任何人
  3. 來自互聯網上任何人經過身份驗證的連接的郵件

如果郵件與上述內容之一不匹配,則郵件伺服器將拒絕該郵件,即使垃圾郵件發送者在您的網域中放置了一些虛假地址作為寄件者地址。

答案2

實際上是否有一些我沒有看到的身份驗證正在進行

是的

或者這是作為內部電子郵件的開放中繼?

否,因為您看到訪問被拒絕

如果是這種情況,如何強制對所有電子郵件進行身份驗證?

你現在強迫它

遠端登入您的電子郵件伺服器

telnet ipaddress 25

相關內容