Linux

postfix/dovecot 說“沒有給出 postmaster_address 設置”,但它是

  • June 27, 2016

我正在嘗試將 postfix 和 dovecot 配置為與儲存在 MySQL 中的虛擬域一起工作,但是每當郵件從 postfix 傳遞到 dovecot 時,我都會遇到這種情況。

Apr 26 11:54:40 smtp postfix/pipe[13165]: 20CCE1C30D5: to=<james@domain.ext>, relay=dovecot, delay=45846, delays=45846/0.28/0/0.14, dsn=4.3.0, status=deferred (temporary failure. Command output: lda: Error: user james@domain.ext: Error reading configuration: Invalid settings: postmaster_address setting not given lda: Fatal: Internal error occurred. Refer to server log for more information. )

現在,因為我確實知道 Google 的工作原理,所以我發現很多關於“您需要將 postmaster_address 選項添加到 15-lda.conf 中的 lda 協議行”的參考資料。

是的,這是輸出doveconf -n

# 2.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 3.13.0-49-generic i686 Ubuntu 14.04.2 LTS ext4
auth_debug = yes
auth_mechanisms = plain login
auth_verbose = yes
disable_plaintext_auth = no
last_valid_uid = 5000
mail_debug = yes
mail_gid = vmail
mail_location = maildir:/var/mail/virtmail/%d/%n
mail_uid = vmail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
namespace inbox {
 inbox = yes
 list = yes
 location = maildir:/var/mail/virtmail/%d/%n
 mailbox Drafts {
   special_use = \Drafts
 }
 mailbox Junk {
   special_use = \Junk
 }
 mailbox Sent {
   special_use = \Sent
 }
 mailbox "Sent Messages" {
   special_use = \Sent
 }
 mailbox Trash {
   special_use = \Trash
 }
 prefix =
 separator = /
 subscriptions = yes
 type = private
}
passdb {
 args = /etc/dovecot/dovecot-sql.conf.ext
 driver = sql
}
plugin {
 mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
 sieve = ~/.dovecot.sieve
 sieve_dir = ~/sieve
}
postmaster_address = postmaster@piku.xyz
protocols = imap pop3 sieve
service auth {
 unix_listener /var/spool/postfix/private/auth {
   group = postfix
   mode = 0666
   user = postfix
 }
 unix_listener /var/spool/postfix/private/dovecot-auth {
   group = postfix
   mode = 0660
   user = postfix
 }
 unix_listener auth-userdb {
   group = vmail
   mode = 0600
   user = vmail
 }
}
ssl_cert = </etc/ssl/private/home.piku.org.uk.crt
ssl_cipher_list = ALL:!LOW:!SSLv2:ALL:!aNULL:!ADH:!eNULL:!EXP:RC4+RSA:+HIGH:+MEDIUM
ssl_key = </etc/ssl/private/home.piku.org.uk.key
userdb {
 args = /etc/dovecot/dovecot-sql.conf.ext
 driver = sql
}
protocol imap {
 imap_client_workarounds = delay-newmail
 mail_max_userip_connections = 100
}
protocol pop3 {
 mail_max_userip_connections = 10
 pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
protocol lda {
 deliver_log_format = msgid=%m: %$
 mail_plugins = sieve sieve
 postmaster_address = postmaster
 quota_full_tempfail = yes
 rejection_reason = Your message to <%t> was automatically rejected:%n%r
}

我的*/etc/postfix/master.cf*包含這個以將其連接到 dovecot

dovecot      unix   -        n      n       -       -   pipe
       flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -d $(recipient)

我還能檢查什麼以查看導致此錯誤的原因?

我修復了它,但修復不是那麼明顯。

缺少 postmaster_address 設置並不是真正的問題。dovecot-lda 沒有查看正確的配置文件是實際問題

然而,更深層次的問題似乎是我在 Google https://bugs.launchpad.net/ubuntu/+source/dovecot/+bug/671065上隨機遇到的這個“功能”

deliver配置 (LDA) 儲存在“/etc/dovecot/conf.d/01-mail-stack-delivery.conf”中。這從根本上被破壞了,因為 dovecotdeliver忽略了包含在 !include_try 和 !include 中的文件。此問題顯示此錯誤:

Fatal: postmaster_address setting not given

並通過添加-c /etc/dovecot/conf.d/01-mail-stack-delivery.confmaster.cf中的 dovecot-lda 命令行來解決(儘管您必須使 conf.d 和文件本身都是世界可讀的,以便非 root 的 dovecot-lda 可以讀取它,這感覺就像可怕的黑客,而不是實際的解決方案……但現在我有工作郵件。

我把這個答案留在這裡,以防有其他人在使用 Ubuntu 時遇到這種情況。願你花的時間比我修復它的時間少。

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