我正在尝试配置 postfix 和 dovecot 以便与存储在 MySQL 中的虚拟域一起工作,但是每当邮件从 postfix 传递到 dovecot 时我都会遇到这种情况。
Apr 26 11:54:40 smtp postfix/pipe[13165]: 20CCE1C30D5: to=<[email protected]>, relay=dovecot, delay=45846, delays=45846/0.28/0/0.14, dsn=4.3.0, status=deferred (temporary failure. Command output: lda: Error: user [email protected]: 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 = [email protected]
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)
我还可以检查什么来查看导致此错误的原因?
答案1
我修复了它,但是修复效果不太明显。
缺少 postmaster_address 设置并不是实际问题。dovecot-lda 没有查看正确的配置文件才是真正的问题。
然而更深层次的问题似乎是我在谷歌上偶然发现的这个“功能”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.conf
通过在 dovecot-lda 命令行中添加主配置文件(尽管您必须使 conf.d 和文件本身都是可读的,以便非 root dovecot-lda 可以读取它,这感觉像是一个可怕的黑客攻击,而不是一个真正的解决方案......但现在我有可用的邮件了。
我把这个答案留在这里,以防其他使用 Ubuntu 的人遇到这种情况。希望你花的时间比我少,这样就能解决这个问题。
答案2
对我来说更好的答案是添加
postmaster_address=postmaster at DOMAIN
显然用你的实际域名代替你的
/etc/dovecot/dovecot.conf
然后重新启动 dovecot
service dovecot restart
不是我的答案...我只是在这里找到它: https://github.com/mail-in-a-box/mailinabox/issues/31 它解决了我的问题。