我跟着本指南关于 linode在我的 Ubuntu 12.04.2 LTS 上设置 dovecot 和 postfix 邮件服务器。设置需要套接字/var/spool/postfix/private/dovecot-lmtp
作为虚拟传输。但是,在我的设置中,启动服务时此套接字文件不存在。而我lmtp
在 中有这行/etc/dovecot/conf.d/10-master.conf
。
这是有关我的服务器的一些信息。
Linux prosp 3.8.4-linode50 #1 SMP Mon Mar 25 15:50:29 EDT 2013 i686 i686 i386 GNU/Linux
root@prosp:/var/spool/postfix/private# ls
anvil bsmtp dovecot-auth lmtp mailman relay scache tlsmgr verify
auth defer error local proxymap retry scalemail-backend trace virtual
bounce discard ifmail maildrop proxywrite rewrite smtp uucp
root@prosp:/var/spool/postfix/private# aptitude show postfix postfix-mysql dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql
Package: postfix
State: installed
Version: 2.9.6-1~12.04.1
Package: postfix-mysql
State: installed
Version: 2.9.6-1~12.04.1
Package: dovecot-core
State: installed
Version: 1:2.0.19-0ubuntu2
Package: dovecot-imapd
State: installed
Version: 1:2.0.19-0ubuntu2
Package: dovecot-pop3d
State: installed
Version: 1:2.0.19-0ubuntu2
Package: dovecot-lmtpd
State: installed
Version: 1:2.0.19-0ubuntu2
Package: dovecot-mysql
State: installed
Version: 1:2.0.19-0ubuntu2
来自 10-master.conf 的部分
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
mode = 0600
user = postfix
group = postfix
}
# Create inet listener only if you can't use the above UNIX socket
inet_listener lmtp {
# Avoid making LMTP visible for the entire internet
address = 127.0.0.1
port = 2424
}
}
我想知道为什么它不存在。我尝试重新安装 dovecot-lmtpd,但没有成功。而且由于 lmtp 套接字不存在,我的邮件服务器可以发送电子邮件但无法接收。收到来信时,邮件日志中有此行:
May 31 09:05:24 postfix/lmtp[3664]: 2FD80321F4: to=<[email protected]>, relay=none, delay=0.41, delays=0.41/0/0/0, dsn=4.4.1, status=deferred (connect to me.com[private/dovecot-lmtp]: No such file or directory)
dovecot重启后的日志:
May 31 11:38:10 host dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
May 31 11:38:10 host dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
May 31 11:38:10 host dovecot: master: Dovecot v2.0.19 starting up (core dumps disabled)
May 31 11:38:11 host postfix/smtpd[5741]: connect from localhost.localdomain[127.0.0.1]
May 31 11:38:11 host dovecot: auth-worker: mysql(127.0.0.1): Connected to database mailserver
May 31 11:38:11 host postfix/smtpd[5741]: 3F8A24DE2A3: client=localhost.localdomain[127.0.0.1], sasl_method=PLAIN, [email protected]
May 31 11:38:11 host postfix/cleanup[5751]: 3F8A24DE2A3: message-id=<[email protected]>
May 31 11:38:11 host postfix/qmgr[5683]: 3F8A24DE2A3: from=<[email protected]>, size=938, nrcpt=1 (queue active)
May 31 11:38:11 host postfix/smtpd[5741]: disconnect from localhost.localdomain[127.0.0.1]
May 31 11:38:11 host postfix/error[5753]: 3F8A24DE2A3: to=<[email protected]>, relay=none, delay=0.05, delays=0.04/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to otherdomain.com[private/dovecot-lmtp]: No such file or directory)
知道为什么会发生这种情况吗?
看起来我也不能使用 lmtp 作为 inet 监听器:
May 31 12:22:48 host postfix/lmtp[6798]: connect to localhost[127.0.0.1]:2424: Connection refused
May 31 12:22:48 host postfix/lmtp[6798]: connect to localhost[::1]:2424: Connection refused
May 31 12:22:48 host postfix/lmtp[6799]: connect to localhost[127.0.0.1]:2424: Connection refused
May 31 12:22:48 host postfix/lmtp[6799]: connect to localhost[::1]:2424: Connection refused
答案1
已经给出的答案和回复包含了解决方案的所有部分,这是我在努力解决并解决了同样的问题之后尝试将这些信息联系在一起的尝试:
概述:Dovecot 仅对出现在设置中的service lmtp
部分起作用。特别是如果您有自定义文件,您可能会忽略某些内容。lmtp
protocols
dovecot.conf
细节(适用于 Debian,以及 Ubuntu):以下是关键步骤,
apt-get install dovecot-lmtpd
- 检查
dovecot.conf
(在/etc/dovecot
)中是否包含以下行!include_try /usr/share/dovecot/protocols.d/*.protocol
:这是protocols
设置的位置(具体来说,lmtp.protocol
文件包含protocols = $protocols lmtp
现在到该
service lmtp
部分:这应该在conf.d/10-master.conf
但可能是空的;原始问题在此部分中有设置(如果您正在做同样的事情,请相应地进行调整):service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { mode = 0600 user = postfix group = postfix } }
确保你的(通常包含)
conf.d/10-master.conf
中包含上述内容dovecot.conf
!include conf.d/*.conf
- 重新加载 Dovecot (
service dovecot reload
) 以使此配置更改生效 - 使用以下命令仔细检查运行配置
dovecot -n
:检查是否protocols
已设置并包含lmtp
;检查上述service lmtp
节是否也出现。 - 如果你
dovecot-lmtp
像上面一样指定套接字名称,它现在应该存在(该service ltmp
节告诉 Dovecot 在运行时创建它),请检查ls -l /var/spool/postfix/private/dovecot-lmtp
- 现在它应该可以与 Postfix 顺利配合了。
答案2
我发现虽然我protocols = lmtp pop3 imap
在 中有/etc/dovecot/dovecot.conf
,但它被/etc/dovecot/conf.d/01-mail-stack-delivery.conf
仅包含 的覆盖了protocols = pop3 imap sieve
。我修改了此文件,并且 lmtp 协议已启动。
答案3
https://packages.debian.org/sid/dovecot-lmtpd
apt-get 安装 dovecot-lmtpd
答案4
这是非常有趣的事情。我在这里读到的所有事情我都做过。在我的私人目录中有一个
/var/spool/postfix/private/lmtp
但不是
/var/spool/postfix/private/dovecot-lmtp
所以后缀告诉我: