postfix/dovecot 说“没有给出 postmaster_address 设置”,但它是

Pik*_*iku 6 linux email-server postfix dovecot

我正在尝试将 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. )
Run Code Online (Sandbox Code Playgroud)

现在,因为我知道 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
}
Run Code Online (Sandbox Code Playgroud)

我的/etc/postfix/master.cf包含它以将它连接到 dovecot

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

我还能检查什么以查看导致此错误的原因?

Pik*_*iku 9

我修复了它,但修复不是那么明显。

缺少 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
Run Code Online (Sandbox Code Playgroud)

并且通过添加-c /etc/dovecot/conf.d/01-mail-stack-delivery.confmaster.cf 中的 dovecot-lda 命令行来治愈(尽管您必须使 conf.d 和文件本身都具有世界可读性,以便非根 dovecot-lda 可以读取它,这感觉就像可怕的黑客,而不是实际的解决方案......但现在我有工作邮件。

我把这个答案留在这里,以防有其他人在使用 Ubuntu 时遇到这种情况。愿你花的时间比我修复它的时间少。