我使用本教程将电子邮件转发到测试邮件服务器和 Gmail 上的另一个电子邮件地址,但没有效果。
http://www.cyberciti.biz/faq/linux-unix-bsd-postfix-forward-email-to-another-account/
我怎样才能找出问题所在?
- 我如何知道主服务器是否收到了我的邮件?
- 我如何才能查明我的转发方法存在什么问题?
Postfix 日志:
Sep 9 12:18:17 server postfix/sendmail[10080]: fatal: bad string length 0 < 1: setgid_group =
Sep 9 12:19:23 server postfix/master[12006]: fatal: bind 0.0.0.0 port 25: Address already in use
Sep 9 12:28:24 server postfix/master[25885]: fatal: bind 0.0.0.0 port 25: Address already in use
Sep 9 12:30:40 server postfix/postfix-script[28876]: fatal: the Postfix mail system is not running
Sep 9 12:30:42 server postfix/postfix-script[28955]: fatal: the Postfix mail system is not running
Sep 9 12:31:13 server postfix/master[29748]: fatal: bind 0.0.0.0 port 25: Address already in use
Sep 9 12:31:14 server postfix/master[29936]: fatal: bind 0.0.0.0 port 25: Address already in use
Sep 9 12:32:03 server postfix/master[31197]: fatal: bind 0.0.0.0 port 25: Address already in use
Sep 9 12:34:01 server postfix/postdrop[2200]: warning: unable to look up public/pickup: No such file or directory
Sep 9 12:34:57 server postfix/master[3820]: fatal: bind 0.0.0.0 port 25: Address already in use
Sep 9 12:35:01 server postfix/postdrop[3967]: warning: unable to look up public/pickup: No such file or directory
Sep 9 12:35:07 server postfix/master[4205]: fatal: bind 0.0.0.0 port 25: Address already in use
Sep 9 12:38:02 server postfix/postdrop[7888]: warning: unable to look up public/pickup: No such file or directory
Sep 9 12:39:02 server postfix/postdrop[9301]: warning: unable to look up public/pickup: No such file or directory
Sep 9 12:49:01 server postfix/postdrop[22743]: warning: unable to look up public/pickup: No such file or directory
Sep 9 12:56:01 server postfix/postdrop[1193]: warning: unable to look up public/pickup: No such file or directory
Sep 9 12:57:01 server postfix/postdrop[2747]: warning: unable to look up public/pickup: No such file or directory
Sep 9 12:58:01 server postfix/postdrop[4245]: warning: unable to look up public/pickup: No such file or directory
Sep 9 13:26:01 server postfix/postdrop[11767]: warning: unable to look up public/pickup: No such file or directory
Sep 9 13:37:01 server postfix/postdrop[27388]: warning: unable to look up public/pickup: No such file or directory
Sep 9 13:38:01 server postfix/postdrop[28812]: warning: unable to look up public/pickup: No such file or directory
Sep 9 13:39:01 server postfix/postdrop[30206]: warning: unable to look up public/pickup: No such file or directory
Sep 9 13:52:01 server postfix/postdrop[15271]: warning: unable to look up public/pickup: No such file or directory
Sep 9 13:53:01 server postfix/postdrop[16820]: warning: unable to look up public/pickup: No such file or directory
Sep 9 14:04:02 server postfix/postdrop[32421]: warning: unable to look up public/pickup: No such file or directory
Sep 9 14:05:02 server postfix/postdrop[1492]: warning: unable to look up public/pickup: No such file or directory
Sep 9 14:08:01 server postfix/postdrop[5150]: warning: unable to look up public/pickup: No such file or directory
Sep 9 14:09:01 server postfix/postdrop[6297]: warning: unable to look up public/pickup: No such file or directory
Sep 9 14:10:01 server postfix/postdrop[7659]: warning: unable to look up public/pickup: No such file or directory
Netstat 用于监听端口:
root@server:~# netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 18906/popa3d
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 8554/nginx
tcp 0 0 183.23.14.12:53 0.0.0.0:* LISTEN 26997/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 26997/named
tcp 0 0 0.0.0.0:8342 0.0.0.0:* LISTEN 2577/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 31700/sendmail: MTA
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 26997/named
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 31700/sendmail: MTA
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN 2269/memcached
tcp6 0 0 :::80 :::* LISTEN 8554/nginx
tcp6 0 0 :::53 :::* LISTEN 26997/named
tcp6 0 0 :::8342 :::* LISTEN 2577/sshd
tcp6 0 0 ::1:953 :::* LISTEN 26997/named
tcp6 0 0 :::3306 :::* LISTEN 2500/mysqld
udp 0 0 127.0.0.1:11211 0.0.0.0:* 2269/memcached
udp 0 0 183.23.14.12:53 0.0.0.0:* 26997/named
udp 0 0 127.0.0.1:53 0.0.0.0:* 26997/named
udp 0 0 183.23.14.12:123 0.0.0.0:* 2202/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 2202/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 2202/ntpd
udp6 0 0 :::53 :::* 26997/named
udp6 0 0 ee82::5247:5dfe:fa7:321 :::* 2202/ntpd
udp6 0 0 ::1:123 :::* 2202/ntpd
udp6 0 0 :::123 :::* 2202/ntpd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 9995 2214/dbus-daemon /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 5401 2502/php-fpm.conf) /var/run/php5-fpm.sock
unix 2 [ ACC ] STREAM LISTENING 161280317 31700/sendmail: MTA /var/run/sendmail/mta/smcontrol
unix 2 [ ACC ] STREAM LISTENING 10078 2500/mysqld /var/run/mysqld/mysqld.sock
unix 2 [ ACC ] SEQPACKET LISTENING 9587 404/udevd /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 6527 2270/acpid /var/run/acpid.socket
解决端口25冲突并清除日志文件后:
root@server:~# cat /var/log/mail.log
Sep 10 00:44:19 server postfix/master[12480]: terminating on signal 15
Sep 10 00:44:19 server postfix/master[15838]: daemon started -- version 2.9.6, configuration /etc/postfix
答案1
似乎您有 2 个 SMTPD 正在运行。netstat -lnp
以 root 身份使用并查找正在监听端口 25(本地地址列)的内容。然后关闭该程序并尝试再次启动 postfix。
更新,我现在看到了 netstat。如果你看看中间,你会看到一行写着 127.0.0.1:25。这意味着 sendmail 正在监听本地传送。你应该停止 sendmail 服务并将其禁用。
service sendmail stop
chkconfig sendmail off