Postfix

ubuntu 上的郵件伺服器(postfix+dovecot+squirrelmail)

  • May 15, 2011

我必須設置一個郵件伺服器(ubuntu 雲伺服器),並且我正在我的家用電腦(ubuntu vm)上準備它,以確保我的經理可以正常工作並且我可以。我按照教程開始使用 Postfix、Dovecot 和 Squirrelmail ,如果它在這里工作,那麼我可以開始在雲伺服器上做。家用電腦具有動態公共 IP 地址(僅當我重新啟動路由器時 IP 才會更改),並且我已為此公共 ip(A- lts.mooo.com, MX- maillts.mooo.com) 註冊了一個可以全域解析的試用域。

我在從伺服器發送和接收郵件時遇到問題。我無法向 gmail 帳戶發送郵件,但我能夠向 yahoo 發送郵件 2.3 次,之後我就不能(這裡的日誌顯示如下)。

以下是我的郵件伺服器配置,


後綴

myhostname = lts.mooo.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mooo.com, lucid, localhost.localdomain, localhost
relayhost =
mynetworks = 192.168.1.4 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth-client
smtpd_sasl_local_domain = mooo.com
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
#inet_interfaces = all



smtpd_tls_auth_only = no
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom



home_mailbox = Maildir/
smtpd_sasl_authenticated_header = no
smtpd_sender_restrictions =
mailbox_command =
smtp_use_tls = no
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = medium

Dovecote:剛剛按照教程進行了更改。


/var/log/mail.log :

May 14 21:49:11 lucid dovecot: imap-login: Login: user=<user1>, method=PLAIN, rip=183.82.61.111, lip=192.168.1.4
May 14 21:49:11 lucid dovecot: IMAP(user1): Disconnected: Logged out bytes=79/669
May 14 21:49:13 lucid dovecot: imap-login: Login: user=<user1>, method=PLAIN, rip=183.82.61.111, lip=192.168.1.4
May 14 21:49:13 lucid dovecot: IMAP(user1): Disconnected: Logged out bytes=79/669
May 14 21:51:52 lucid postfix/qmgr[5902]: 0D71442EF8: from=<user1@mooo.com>, size=3839, nrcpt=1 (queue active)
May 14 21:51:52 lucid postfix/smtp[6110]: 0D71442EF8: to=<myyahoo-id-here@yahoo.co.in>, relay=mx1.mail.in.yahoo.com[180.222.96.138]:25, delay=12946, delays=12946/0.12/0.06/0, dsn=4.7.1, status=deferred (host mx1.mail.in.yahoo.com[180.222.96.138] refused to talk to me: 553 5.7.1 [BL21] Connections will not be accepted from 183.82.61.111, because the ip is in Spamhaus's list; see http://postmaster.yahoo.com/550-bl23.html)
May 14 21:52:26 lucid postfix/anvil[5918]: statistics: max connection rate 1/60s for (smtp:183.82.61.111) at May 14 21:47:12
May 14 21:52:26 lucid postfix/anvil[5918]: statistics: max connection count 1 for (smtp:183.82.61.111) at May 14 21:47:12
May 14 21:52:26 lucid postfix/anvil[5918]: statistics: max cache size 1 at May 14 21:47:12

我還沒有收到任何從外部域(雅虎,Google到 user1@mooo.com)發送的郵件(我知道沒有選擇動態公共 ip,但想檢查它是否有效)。我需要一些幫助,以便我可以接收來自任何域的郵件並發送到任何域。

我希望有些人正在執行他們自己的郵件伺服器,並且可以在這裡幫助我找出我做錯的地方,提供一些線索和資訊來實現我的目標。

謝謝!


編輯:1

添加了域記錄的螢幕截圖, 免費域名註冊


編輯:2

   May 15 17:14:49 lucid postfix/smtp[2858]: 1DC8942EAF: to=<my-id-here@yahoo.co.in>, relay=mx1.mail.in.yahoo.com[180.222.96.138]:25, delay=2.7, delays=0.15/0.28/0.12/2.2, dsn=2.0.0, status=sent (250 ok dirdel)
   May 15 17:14:50 lucid postfix/smtp[2857]: 1DC8942EAF: to=<my-id-here@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.155.27]:25, delay=3.3, delays=0.15/0.12/1.8/1.2, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[74.125.155.27] said: 550-5.7.1 [183.82.62.102] The IP you're using to send mail is not authorized to 550-5.7.1 send email directly to our servers. Please use the SMTP relay at your 550-5.7.1 service provider instead. Learn more at                          550 5.7.1 http://mail.google.com/support/bin/answer.py?answer=10336 o5si12424488wfn.122 (in reply to end of DATA command))
   May 15 17:14:50 lucid postfix/cleanup[2855]: 8C22D42EF3: message-id=<20110515114450.8C22D42EF3@lts.mooo.com>
   May 15 17:14:50 lucid postfix/bounce[2863]: 1DC8942EAF: sender non-delivery notification: 8C22D42EF3
   May 15 17:14:50 lucid postfix/qmgr[2734]: 1DC8942EAF: removed
   May 15 17:14:50 lucid postfix/qmgr[2734]: 8C22D42EF3: from=<>, size=4155, nrcpt=1 (queue active)
May 15 17:14:51 lucid postfix/smtp[2858]: 8C22D42EF3: to=<user1@mooo.com>, relay=mail.afraid.org[67.19.72.201]:25, delay=1.2, delays=0.06/0.01/0.75/0.34, dsn=5.7.1, status=bounced (host mail.afraid.org[67.19.72.201] said: 554 5.7.1 Service unavailable; Client host [183.82.62.102] blocked using cbl.abuseat.org; Blocked - see http://cbl.abuseat.org/lookup.cgi?ip=183.82.62.102 (in reply to RCPT TO command))
May 15 17:14:52 lucid postfix/qmgr[2734]: 8C22D42EF3: removed

mooo.com 的 MX 記錄表明您的郵件由 mail.afraid.org 處理。當我嘗試通過 mail.afraid.org 向 user1@mooo.com 發送電子郵件時,它顯示“虛擬地址表中的使用者未知”。

至於為什麼您的外發郵件失敗,請查看您的日誌:

Connections will not be accepted from 183.82.61.111, because the ip is in Spamhaus's list

您似乎對是為 mooo.com 還是為 lts.mooo.com 發送和接收郵件感到困惑。如果您希望 maillts.mooo.com 接收發送到 user1@mooo.com 的電子郵件,那麼您需要 mooo.com 的 MX 記錄,該記錄指定 maillts.mooo.com,而不是 mail.afraid.org。由於它現在已設置,它應該會收到 user1@lts.mooo.com 的電子郵件,但您的 Postfix 配置似乎沒有在 mydestination 部分指定。

引用自:https://serverfault.com/questions/269764