Php

Plesk RHEL - 當來自我的伺服器以外的 IP 時未收到電子郵件

  • November 6, 2011

我的伺服器執行 PHP 5.3.8,並且存在無法接收來自不在我的伺服器中的帳戶發送的電子郵件的問題。

例如,如果我通過我的部落格“blog123.com”上的聯繫表格向“astroman@blog123.com”之類的電子郵件送出消息,則會收到該電子郵件。

但是,如果我從 Gmail 發送電子郵件至“astroman@blog123.com”,則不會收到任何電子郵件。

我可以從此伺服器上的帳戶向任何目的地發送消息,沒問題。

我檢查了日誌

/usr/local/psa/var/log/maillog

並且沒有錯誤,但是我在這里和那裡看到了

Nov  5 18:51:53 p2457330 postfix/smtp[3609]: certificate verification failed for gmail-smtp-in.l.google.com: num=27:certificate not trusted

不確定它是否與問題有關。

任何想法如何解決這個問題?

這是 postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases, hash:/var/spool/postfix/plesk/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 10240000
mydestination = localhost.$mydomain, localhost, localhost.localdomain
myhostname = excample.com
mynetworks = 127.0.0.0/8, 10.2.0.157/32
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_send_xforward_command = yes
smtp_tls_security_level = may
smtp_use_tls = no
smtpd_authorized_xforward_hosts = 127.0.0.0/8
smtpd_client_restrictions = 
smtpd_proxy_timeout = 3600s
smtpd_recipient_restrictions = permit_mynetworks, check_client_access pcre:/var/spool/postfix/plesk/no_relay.re, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
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
smtpd_timeout = 3600s
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
transport_maps = hash:/var/spool/postfix/plesk/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual
virtual_gid_maps = static:31
virtual_mailbox_base = /var/qmail/mailnames
virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
virtual_mailbox_maps = hash:/var/spool/postfix/plesk/vmailbox
virtual_transport = plesk_virtual
virtual_uid_maps = static:110

Netstat 資訊(僅供參考,出於安全原因,我的 IP “29.5.29.3”是虛擬的)

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:993                 0.0.0.0:*                   LISTEN      30793/couriertcpd   
tcp        0      0 0.0.0.0:225                 0.0.0.0:*                   LISTEN      2391/xinetd         
tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN      30810/couriertcpd   
tcp        0      0 127.0.0.1:10025             0.0.0.0:*                   LISTEN      2619/master         
tcp        0      0 127.0.0.1:10026             0.0.0.0:*                   LISTEN      2619/master         
tcp        0      0 0.0.0.0:106                 0.0.0.0:*                   LISTEN      2391/xinetd         
tcp        0      0 0.0.0.0:2123                0.0.0.0:*                   LISTEN      11744/dsmcad        
tcp        0      0 127.0.0.1:10027             0.0.0.0:*                   LISTEN      2619/master         
tcp        0      0 0.0.0.0:1581                0.0.0.0:*                   LISTEN      11744/dsmcad        
tcp        0      0 0.0.0.0:110                 0.0.0.0:*                   LISTEN      30801/couriertcpd   
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN      30783/couriertcpd   
tcp        0      0 0.0.0.0:8880                0.0.0.0:*                   LISTEN      18708/sw-cp-serverd 
tcp        0      0 127.0.0.1:10001             0.0.0.0:*                   LISTEN      18708/sw-cp-serverd 
tcp        0      0 0.0.0.0:465                 0.0.0.0:*                   LISTEN      2619/master         
tcp        0      0 29.5.29.3:53           0.0.0.0:*                   LISTEN      18417/named         
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      18417/named         
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      2391/xinetd         
tcp        0      0 127.0.0.1:3000              0.0.0.0:*                   LISTEN      1288/drwebd.real    
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      18417/named         
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      2619/master         
tcp        0      0 0.0.0.0:8443                0.0.0.0:*                   LISTEN      18708/sw-cp-serverd 
tcp        0      0 :::3306                     :::*                        LISTEN      20884/mysqld        
tcp        0      0 :::80                       :::*                        LISTEN      841/httpd           
tcp        0      0 :::22                       :::*                        LISTEN      11198/sshd          
tcp        0      0 :::443                      :::*                        LISTEN      841/httpd           
udp        0      0 29.5.29.3:53           0.0.0.0:*                               18417/named         
udp        0      0 127.0.0.1:53                0.0.0.0:*                               18417/named         
udp        0      0 29.5.29.3:123          0.0.0.0:*                               2407/ntpd           
udp        0      0 127.0.0.1:123               0.0.0.0:*                               2407/ntpd           
udp        0      0 0.0.0.0:123                 0.0.0.0:*                               2407/ntpd           
udp        0      0 fe80::230:48ff:fefa:123     :::*                                    2407/ntpd           
udp        0      0 ::1:123                     :::*                                    2407/ntpd           
udp        0      0 :::123                      :::*                                    2407/ntpd

這是由於我的 ISP 對防火牆的配置過於嚴格而導致的問題。在致電並檢查了可能性之後,他們發現了防火牆問題,現在一切都按預期工作了。

這裡有幾件事可能是錯誤的:

首先,您應該檢查 postfix 是否正在偵聽正確的介面 ( netstat -tulpn)。但我認為它沒有監聽任何 WAN 地址,因為它在配置文件中:

mynetworks = 127.0.0.0/8, 10.2.0.157/32

(我真的希望您的伺服器不在 LAN 中)所以,將您的 WAN-IP 添加到此列表中。我看到你已經安裝了 plesk,所以也許你可以在 plesk 的某個地方配置它,但我不知道,因為我對 Plesk 一無所知。

接下來,檢查您的域的 MX 設置。它指向您的伺服器嗎?

引用自:https://serverfault.com/questions/328165