Postfix

Postfix + Dovecot + IMAP SSL: imap-login: Aborted login

  • September 8, 2015

熟悉電子郵件郵件伺服器組件和配置。

知道 Dovecot 2.x 有很多配置更改並且願意使用 SSL 加密,我遇到了這個指南。帶有 SSL 配置的 Postfix、Dovecot 和 POP。IMAP 和 SSL 之間的區別只是軟體包(dovecot-imapd 和 dovecot-pop3d)和“/etc/dovecot/conf.d/10-master.conf”中的參數的區別。

已徹底遵循指南,創建了 2 個電子郵件使用者帳戶。在嘗試連接OSX Mail 程序時,我首先遇到了以下問題。

dovecot: auth: Error: passwd-file /etc/dovecot/passwd: User xx@domain is missing userdb info 

注意到使用者名和密碼儲存在單獨的文件中,我更改了“/etc/dovecot/conf.d/auth-system.conf.ext”以包含使用者文件,如下所示

passdb {
 driver = passwd-file
 args = scheme=cram-md5 username_format=%u /etc/dovecot/passwd
 #driver = pam
 #[session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=<n>]
 #[cache_key=<key>] [<service name>]
 #args = dovecot
}

userdb {
 driver = passwd-file
 args = username_format=%u /etc/dovecot/users
 #<doc/wiki/AuthDatabase.Passwd.txt>
 #driver = passwd
 #[blocking=no]
 #args =

 # Override fields from passwd
 #override_fields = home=/home/virtual/%u
}

同樣在與此處類似的問題之後,我還通過評論更改了“etc/postfix/main.cf”:

smtpd_sasl_application_name = smtpd

一切都很好,除了我面臨的最後一個問題。Postfix 當然可以,使用mailutils發送測試電子郵件。錯誤資訊是:

dovecot: imap-login: Aborted login (auth failed, 1 attempts in 2 secs): user=xx, method=LOGIN, rip=xx.xx.xx.xx, lip=xx.xx.xx.xx, TLS, session=<xxxxxxx> 

我只在埠 993 和 587 上分別使用 IMAP 和 SSH STARTTLS。這麼說是因為我的 Amazon EC2 Ubuntu 14.04 實例上的UFW Firewall阻止了其他電子郵件協議埠。奇怪的是,當從另一個域帳戶向我的域發送電子郵件時,“/home/vmail/domain/user/new”下沒有顯示電子郵件跟踪。還設置了相關的DNS記錄如下:

* 10800 IN A server-ip
@ 10800 IN A server-ip
@ 10800 IN MX 10 mail.mydomain 

這是我的情況;任何意見將不勝感激。

在 /etc/postfix/master.cf 添加:

dovecot   unix  -       n       n       -       -       pipe
 flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}

在 /etc/postfix main.cf 添加:

dovecot_destination_recipient_limit = 1
virtual_mailbox_domains = your.domain.here
virtual_transport = dovecot 

這假設使用者 vmail 是 /home/virtual 的所有者,根據需要進行調整。

如果在確認您在 postfix 中有此配置後仍然有問題,請發布完整的 postfix(隨時清理域資訊到 examplelt.com 等)和 dovecot 配置文件。

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