Postfix Mail服务器拒绝从wordpress网站发送邮件


10

我最近在Linode上使用Postfix,Dovecot和MySQL设置了一个邮件服务器。我可以从邮件客户端(Outlook)发送和接收邮件,但是任何时候我尝试从我设计的wordpress网站与用户发送邮件都行不通。这是错误日志的输出:

Oct 27 18:36:52 hostname postfix/master[29738]: reload -- version 2.11.0, configuration /etc/postfix
Oct 27 18:37:00 hostname postfix/master[29738]: terminating on signal 15
Oct 27 18:37:00 hostname postfix/master[8304]: daemon started -- version 2.11.0, configuration /etc/postfix
Oct 27 18:37:12 hostname postfix/smtpd[8309]: warning: hostname mydomain.com does not resolve to address 2a01:7e00::f03c:91ff:fecf:e7a6
Oct 27 18:37:12 hostname postfix/smtpd[8309]: connect from unknown[2a01:7e00::f03c:91ff:fecf:e7a6]
Oct 27 18:37:12 hostname postfix/smtpd[8309]: lost connection after UNKNOWN from unknown[2a01:7e00::f03c:91ff:fecf:e7a6]
Oct 27 18:37:12 hostname postfix/smtpd[8309]: disconnect from unknown[2a01:7e00::f03c:91ff:fecf:e7a6]

我的main.cf文件已设置为:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no

readme_directory = no

smtpd_tls_cert_file=/etc/dovecot/dovecot.pem
smtpd_tls_key_file=/etc/dovecot/private/dovecot.pem
smtpd_use_tls=yes
smtpd_tls_auth_only = yes
smtp_tls_security_level = may
smtpd_tls_security_level = may

dovecot
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = hostname.mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mydomain.com, hostname.mydomain.com, localhost.mydomain.com, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

message_size_limit = 20480000
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf, mysql:/etc/postfix/mysql-virtual-email2email.cf

Answers:


10

禁用IPv6

inet_protocols = ipv4

应该做的把戏

使用文本编辑器打开/etc/postfix/main.cf

查找行inet_protocols = all

全部替换为ipv4

重新启动后缀

https://clientarea.ramnode.com/knowledgebase.php?action=displayarticle&id=108


我这样做,但它现在展示我这个错误Oct 28 11:34:22 hostname postfix/smtpd[14321]: warning: hostname mydomain.com does not resolve to address 139.162.209.129 Oct 28 11:34:22 hostname postfix/smtpd[14321]: connect from unknown[139.162.209.129] Oct 28 11:34:22 hostname postfix/smtpd[14321]: lost connection after UNKNOWN from unknown[139.162.209.129] Oct 28 11:34:22 hostname postfix/smtpd[14321]: disconnect from unknown[139.162.209.129]
返厂达拉

我发现错误“主机名mydomain.com无法解析为地址139.162.209.129”是由于DNS记录中出现了混合错误。我已更正此错误,但现在我收到此错误,postfix/smtpd[20609]: connect from localhost[127.0.0.1] lost connection after UNKNOWN from localhost[127.0.0.1] disconnect from localhost[127.0.0.1]我不明白为什么会这样,因为在我允许的网络中列出了IP“ 127.0.0.1”。
Fanan Dala

我终于找到了问题所在。从wordpress网站,我将端口设置为25,但将其更改为465,现在可以正常使用了。
Fanan Dala
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.