在CentOS 5,Postfix上接收电子邮件

问题出在这里:我们的服务器(CentOS 5,Postfix)无法收到邮件,蝙蝠可以发送。

运行tcpdump port 25并从gmail发送电子邮件显示有来自gmail的传入请求

但是,当我运行netstat -nltp il显示有没有进程监听端口25,这里是netstat -nltp的输出:

 tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 17434/couriertcpd tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 17451/couriertcpd tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 28215/master tcp 0 0 127.0.0.1:10026 0.0.0.0:* LISTEN 28215/master tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 6151/mysqld tcp 0 0 0.0.0.0:106 0.0.0.0:* LISTEN 2147/xinetd tcp 0 0 127.0.0.1:10027 0.0.0.0:* LISTEN 28215/master tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 17442/couriertcpd tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 17424/couriertcpd tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 32353/sw-cp-serverd tcp 0 0 127.0.0.1:10001 0.0.0.0:* LISTEN 32353/sw-cp-serverd tcp 0 0 **.***.**.***:53 0.0.0.0:* LISTEN 2292/named tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 2292/named tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2147/xinetd tcp 0 0 0.0.0.0:2006 0.0.0.0:* LISTEN 32353/sw-cp-serverd tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 2488/postmaster tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 2292/named tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 32353/sw-cp-serverd tcp 0 0 :::80 :::* LISTEN 18594/httpd tcp 0 0 :::22 :::* LISTEN 2135/sshd tcp 0 0 :::443 :::* LISTEN 18594/httpd 

还有telnet 127.0.0.1 25的输出telnet 127.0.0.1 25

 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused 

我需要做一些portforwarding?

编辑:这是main.cf

 queue_directory = /var/spool/postfix daemon_directory = /usr/libexec/postfix mail_owner = postfix inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain unknown_local_recipient_reject_code = 550 alias_maps = hash:/etc/aliases, hash:/var/spool/postfix/plesk/aliases alias_database = hash:/etc/aliases debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.3.3/samples readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual virtual_mailbox_maps = hash:/var/spool/postfix/plesk/vmailbox transport_maps = hash:/var/spool/postfix/plesk/transport smtpd_tls_cert_file = /etc/postfix/postfix_default.pem smtpd_tls_key_file = $smtpd_tls_cert_file smtpd_tls_security_level = may smtpd_use_tls = yes smtp_tls_security_level = may smtp_use_tls = no mynetworks = 127.0.0.0/8, **.***.**.***/31 smtpd_sender_restrictions = check_sender_access hash:/var/spool/postfix/plesk/blacklists, permit_sasl_authenticated, check_client_access pcre:/var/spool/postfix/plesk/non_auth.re smtp_send_xforward_command = yes smtpd_authorized_xforward_hosts = 127.0.0.0/8 smtpd_sasl_auth_enable = yes smtpd_recipient_restrictions = permit_mynetworks, check_client_access pcre:/var/spool/postfix/plesk/no_relay.re, permit_sasl_authenticated, reject_unauth_destination virtual_mailbox_base = /var/qmail/mailnames virtual_uid_maps = static:110 virtual_gid_maps = static:31 virtual_transport = plesk_virtual plesk_virtual_destination_recipient_limit = 1 smtpd_client_restrictions = myhostname = *******.com message_size_limit = 10240000 

输出ps -ef |grep postfix

 root 28215 1 0 20:39 ? 00:00:00 /usr/libexec/postfix/master postfix 28218 28215 0 20:39 ? 00:00:00 qmgr -l -t fifo -u postfix 28239 28215 0 20:40 ? 00:00:00 tlsmgr -l -t unix -u postfix 28240 28215 0 20:40 ? 00:00:00 spawn -n 127.0.0.1:10027 -t inet user=mhandlers-user argv=/usr/lib64/plesk-9.0/postfix-queue 127.0.0.1 10026 before-remote postfix 28242 28215 0 20:40 ? 00:00:00 smtpd -n 127.0.0.1:10026 -t inet -u -c -o smtpd_client_restrictions -o smtpd_helo_restrictions -o smtpd_sender_restrictions -o smtpd_recipient_restrictions permit_mynetworks,reject -o smtpd_data_restrictions -o receive_override_options no_unknown_recipient_checks postfix 28539 28215 0 20:57 ? 00:00:00 trivial-rewrite -n rewrite -t unix -u postfix 29058 28215 0 21:27 ? 00:00:00 pickup -l -t fifo -u -c -o content_filter smtp:127.0.0.1:10027 postfix 29314 28215 0 21:41 ? 00:00:00 bounce -z -t unix -u postfix 29338 28215 0 21:44 ? 00:00:00 cleanup -z -t unix -u postfix 29358 28215 0 21:46 ? 00:00:00 smtp -t unix -u postfix 29457 28215 0 21:56 ? 00:00:00 smtp -t unix -u postfix 29716 28215 0 22:08 ? 00:00:00 bounce -z -t unix -u root 29749 29571 0 22:10 pts/3 00:00:00 grep postfix 

它看起来像你的后缀主pid正在监听端口10025和10025。

查看smtpd守护进程的/etc/postfix/master.cf。 我看起来像这样

 smtp inet n - n - - smtpd 

另一个(不太可能)的可能性是你在/ etc / services中smtp 10025 / tcp

更新你的master.cf看起来像给出的例子,然后

 sudo service postfix restart 

什么是输出:

 sudo service postfix status 

如果停止,请运行:

 sudo service postfix start 

请确保/etc/postfix/main.cf将inet_interfaces设置为所有或您希望进行后缀侦听的特定接口。