我的PHP邮件()无法工作

我的PHP邮件()无法工作,php,unix,sendmail,postfix-mta,Php,Unix,Sendmail,Postfix Mta,我有一个很大的头痛,因为PHP邮件功能不工作。我已经重新安装了postfix应用程序,但仍然没有更改! 如果我在端口25向localhost发送telnet,我可以从命令行发送邮件 root@server:/etc/postfix# telnet localhost 25 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 myserver.com.br ESMTP Postfix ehlo 401

我有一个很大的头痛,因为PHP邮件功能不工作。我已经重新安装了postfix应用程序,但仍然没有更改! 如果我在端口25向localhost发送telnet,我可以从命令行发送邮件

root@server:/etc/postfix# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 myserver.com.br ESMTP Postfix
ehlo
401 Syntax: EHLO hostname
ehlo localhost
250-myserver.com.br
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: info@myserver.com.br
250 2.1.0 Ok
rcpt to: testes@gmail.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: Ola

Boas t     
.
250 2.0.0 Ok: queued as A71558AB472
我得到的错误日志如下所示:

Nov 19 15:28:43 myserver postfix/pickup[6186]: 89B898AB477: uid=33 from=<www-data>
Nov 19 15:28:43 myserver postfix/cleanup[6630]: 89B898AB477: message-id=<20131119172843.89B898AB477@myserver.com.br>
Nov 19 15:28:43 myserver postfix/qmgr[6187]: 89B898AB477: from=<www-data@myserver.com.br>, size=361, nrcpt=1 (queue active)
Nov 19 15:28:44 myserver postfix/smtp[6634]: 89B898AB477: to=<testes@hotmail.com>, relay=mx1.hotmail.com[65.55.37.120]:25, delay=0.99, delays=0.17/0.01/0.6/0.2, dsn=4.0.0, status=SOFTBOUNCE (host mx1.hotmail.com[65.55.37.120] said: 550 SC-001 (COL0-MC4-F39) Unfortunately, messages from 201.33.21.60 weren't sent. Please contact your Internet service provider since part of their network is on our block list. You can also refer your provider to http://mail.live.com/mail/troubleshooting.aspx#errors. (in reply to MAIL FROM command))
Nov 19 15:28:44 myserver postfix/smtp[6634]: 89B898AB477: lost connection with mx1.hotmail.com[65.55.37.120] while sending RCPT TO
编辑:现在我发现我可以将此电子邮件发送到另一台服务器,但Hotmail却以某种方式阻止了它。

Hotmail似乎不喜欢信封发送者www-data@myserver.com.brused邮寄地址:

使用telnet查看hotmail是否已准备好接受来自您的主机的具有其他信封发件人地址的邮件。www数据可能不受欢迎/被阻止

如果您将php邮件配置为使用sendmail程序发送,postfix也提供了这样的程序,那么您可以设置另一个信封发送者


看来hotmail正在阻止我的邮件。。。我试着给GMAIL发了一些信息,第一条消息就出来了。 在接下来的电子邮件中,我得到了以下日志

Nov 20 09:26:31 Server postfix/smtp[11729]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400c:c02::1a]:25: Network is unreachable
Nov 20 09:26:32 Server postfix/smtp[11729]: 5A2238AB497: to=<teste@gmail.com>, relay=gmail-smtp-in.l.google.com[173.194.68.26]:25, delay=1.8, delays=0.17/0/1/0$
Nov 20 09:26:32 Server postfix/qmgr[7005]: 5A2238AB497: removed
Nov 20 09:28:20 Server postfix/smtpd[12027]: connect from localhost[127.0.0.1]
Nov 20 09:28:20 Server postfix/trivial-rewrite[12029]: warning: do not list domain myserver.com.br in BOTH mydestination and virtual_mailbox_domains
Nov 20 09:28:20 Server postfix/smtpd[12027]: ACCD08AB497: client=localhost[127.0.0.1]
Nov 20 09:28:20 Server postfix/cleanup[12031]: ACCD08AB497: message-id=<1384946900.528c9cd49418a@www.myserver.com.br>
Nov 20 09:28:20 Server postfix/qmgr[7005]: ACCD08AB497: from=<info@myserver.com.br>, size=1260, nrcpt=1 (queue active)
Nov 20 09:28:20 Server postfix/smtpd[12027]: disconnect from localhost[127.0.0.1]
经过一番搜索,我发现问题出在ipv6配置上,所以我编辑了postfix/main.cf和inet_protocols=All to inet_protocols=ipv4这一行

新的输出是这样的

Nov 20 09:54:49 Server postfix/smtp[12315]: 70A3A8AA103: to=<teste@gmail.com>, relay=gmail-smtp-in.l.google.com[173.194.68.27]:25, delay=2, delays=0.21/0/0.4/1.4, dsn=2.0.0, status=sent (250 2.0.0 OK 1384948492 d5si7115120qcj.49 - gsmtp)
Nov 20 09:54:49 Server postfix/qmgr[12243]: 70A3A8AA103: removed

但是该收件人没有收到他的电子邮件,尽管状态为“OK:

您可以通过这些链接将您的IP地址从Hotmail黑名单中删除

您能告诉我们邮件代码和日志中的任何错误/摘录吗?这是:请联系您的Internet服务提供商,因为他们的部分网络位于我们的阻止列表中。您发送的主机位于垃圾邮件阻止列表中,收件服务器hotmail不接受来自它的邮件。如果这是一个共享主机,这是一个非常常见的困境。共享主机上的其他人正在发送垃圾邮件,这也会影响到您。
Nov 20 09:54:49 Server postfix/smtp[12315]: 70A3A8AA103: to=<teste@gmail.com>, relay=gmail-smtp-in.l.google.com[173.194.68.27]:25, delay=2, delays=0.21/0/0.4/1.4, dsn=2.0.0, status=sent (250 2.0.0 OK 1384948492 d5si7115120qcj.49 - gsmtp)
Nov 20 09:54:49 Server postfix/qmgr[12243]: 70A3A8AA103: removed