我的新邮件服务器(Postfix (3.3.0) 和 Dovecot (v2.2.33.2))还不能工作,自从我几年前上次安装以来,现在我注意到配置发生了很大变化,例如在 Dovecot 中,协议的管理方式不同。它在 Ubuntu 18.04.1 x64 上运行。
现在服务器只能发送邮件,不能接收邮件。肯定是配置出了问题,但我找不到。
我尝试了详细日志记录,没有任何奇怪的消息(据我所知)。否则,“service dovecot status”会发出此警报:starting up without any protocols
这可能是问题所在吗?
网络状态监测
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:10023 0.0.0.0:* LISTEN 1038/postgrey --pid
tcp 0 0 127.0.0.1:10024 0.0.0.0:* LISTEN 1217/amavisd-new (m
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 2551/master
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 963/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 937/nginx: master p
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 2551/master
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 644/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 880/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2551/master
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 937/nginx: master p
tcp6 0 0 2a03:b0c0:0:1010::10023 :::* LISTEN 1038/postgrey --pid
tcp6 0 0 ::1:10023 :::* LISTEN 1038/postgrey --pid
tcp6 0 0 ::1:10024 :::* LISTEN 1217/amavisd-new (m
tcp6 0 0 :::80 :::* LISTEN 937/nginx: master p
tcp6 0 0 :::465 :::* LISTEN 2551/master
tcp6 0 0 :::22 :::* LISTEN 880/sshd
tcp6 0 0 :::25 :::* LISTEN 2551/master
tcp6 0 0 :::443 :::* LISTEN 937/nginx: master p
ufw 状态
To Action From
-- ------ ----
Nginx Full ALLOW Anywhere
OpenSSH ALLOW Anywhere
443/tcp ALLOW Anywhere
587/tcp ALLOW Anywhere
25/tcp ALLOW Anywhere
465/tcp ALLOW Anywhere
993/tcp ALLOW Anywhere
995/tcp ALLOW Anywhere
123/tcp ALLOW Anywhere
2812/tcp ALLOW Anywhere
110/tcp ALLOW Anywhere
143/tcp ALLOW Anywhere
Nginx Full (v6) ALLOW Anywhere (v6)
OpenSSH (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
587/tcp (v6) ALLOW Anywhere (v6)
25/tcp (v6) ALLOW Anywhere (v6)
465/tcp (v6) ALLOW Anywhere (v6)
993/tcp (v6) ALLOW Anywhere (v6)
995/tcp (v6) ALLOW Anywhere (v6)
123/tcp (v6) ALLOW Anywhere (v6)
2812/tcp (v6) ALLOW Anywhere (v6)
110/tcp (v6) ALLOW Anywhere (v6)
143/tcp (v6) ALLOW Anywhere (v6)
服务鸽舍状态
dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-08-10 16:28:55 CEST; 7s ago
Docs: man:dovecot(1)
http://wiki2.dovecot.org/
Main PID: 3122 (dovecot)
Tasks: 4 (limit: 1152)
CGroup: /system.slice/dovecot.service
├─3122 /usr/sbin/dovecot -F
├─3132 dovecot/anvil
├─3133 dovecot/log
└─3136 dovecot/config
Aug 10 16:28:55 domain.tld systemd[1]: Started Dovecot IMAP/POP3 email server.
Aug 10 16:28:55 domain.tld dovecot[3122]: master: Dovecot v2.2.33.2 (d6601f4ec) starting up without any protocols (core dumps disabled)
答案1
日志中的这条记录——上面写着“启动时不使用任何协议”——是一个很大的线索:
Aug 10 16:28:55 domain.tld dovecot[3122]: master: Dovecot v2.2.33.2 (d6601f4ec) starting up without any protocols (core dumps disabled)
看起来 Dovecot 并不知道您在安装时设置了任何协议,所以它只是按原样启动。
在 Debian 上有一个设置。例如,
!include_try /usr/share/dovecot/protocols.d/*.protocol
通过安装相应的软件包自动启用这些协议。dovecot-pop3d
所以这告诉我你需要安装这个dovecot-pop3d
包Ubuntu 官方 Dovecot 页面证实了这一点:
安装非常简单,只需安装以下软件包:
- dovecot-imapd
- dovecot-pop3d
例如,使用 apt-get:
sudo apt-get install dovecot-imapd dovecot-pop3d
因此我建议您继续安装这些软件包,如下所示:
sudo apt-get install dovecot-imapd dovecot-pop3d
完成此操作后,检查/usr/share/dovecot/protocols.d/
目录,您肯定会看到.protocol
其中有一些文件。完成此操作后,只需重新启动 Dovecot 即可。