I'm having a big headache because PHP mail() funcion does not work. I've already reinstalled the postfix app, but still no change! If I do a telnet to localhost in port 25, I can send mails from the command line
我很头疼,因为PHP mail()函数不起作用。我已经重新安装了postfix应用程序,但仍然没有变化!如果我在端口25中telnet到localhost,我可以从命令行发送邮件
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
I have installed the Zpanel before, don't really know if it's this what's messing with PHP mail... What else can it be?
我以前安装过Zpanel,不知道这是不是弄乱了PHP邮件......还有什么呢?
The PHP mail() function I'm using is very simple and works on other servers:
我正在使用的PHP mail()函数非常简单,可以在其他服务器上运行:
mail("testes@hotmail.com","Tell","and","FROM: info@myserver.com.br\n\n");
The error Log that I get is something like this:
我得到的错误日志是这样的:
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
EDIT : Figured out now that I can send this email to another server, but somehow Hotmail is blocking it.
编辑:现在想出我可以将此电子邮件发送到另一台服务器,但不知何故Hotmail阻止它。
3 个解决方案
#1
0
It seems that hotmail does not like envelope sender www-data@myserver.com.br
(used in MAIL FROM:
)
似乎hotmail不喜欢信封发件人www-data@myserver.com.br(用于MAIL FROM :)
Use telnet to find out if hotmail is ready to accept messages from your host with another envelope sender address (www-data may be disliked/blocked).
使用telnet查看hotmail是否已准备好接收来自主机的邮件以及其他信封发件人地址(www-数据可能不受欢迎/阻止)。
If you configure php mail to send using sendmail program (postfix provides such program too) then you may set another envelope sender.
如果您配置php邮件使用sendmail程序发送(postfix也提供此类程序),那么您可以设置另一个信封发件人。
#2
0
So it seems that hotmail is blocking my messages... I tried to send some messages to GMAIL and the first one came out OK. The next emails I got the following logs
所以似乎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]
And after some search I figured out the problem was on ipv6 configurations, so I edited postfix/main.cf and the line inet_protocols = All to inet_protocols = ipv4.
经过一些搜索,我发现问题出现在ipv6配置上,所以我编辑了postfix / main.cf和行inet_protocols = All到inet_protocols = ipv4。
The new output is something like this
新的输出是这样的
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
But this recipient didn't get his emails, although the OK status :(
但这个收件人没有得到他的电子邮件,虽然OK状态:(
#3
0
You may refer on these links to have your IP address remove from Hotmail black list
您可以参考这些链接,从Hotmail黑名单中删除您的IP地址
#1
0
It seems that hotmail does not like envelope sender www-data@myserver.com.br
(used in MAIL FROM:
)
似乎hotmail不喜欢信封发件人www-data@myserver.com.br(用于MAIL FROM :)
Use telnet to find out if hotmail is ready to accept messages from your host with another envelope sender address (www-data may be disliked/blocked).
使用telnet查看hotmail是否已准备好接收来自主机的邮件以及其他信封发件人地址(www-数据可能不受欢迎/阻止)。
If you configure php mail to send using sendmail program (postfix provides such program too) then you may set another envelope sender.
如果您配置php邮件使用sendmail程序发送(postfix也提供此类程序),那么您可以设置另一个信封发件人。
#2
0
So it seems that hotmail is blocking my messages... I tried to send some messages to GMAIL and the first one came out OK. The next emails I got the following logs
所以似乎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]
And after some search I figured out the problem was on ipv6 configurations, so I edited postfix/main.cf and the line inet_protocols = All to inet_protocols = ipv4.
经过一些搜索,我发现问题出现在ipv6配置上,所以我编辑了postfix / main.cf和行inet_protocols = All到inet_protocols = ipv4。
The new output is something like this
新的输出是这样的
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
But this recipient didn't get his emails, although the OK status :(
但这个收件人没有得到他的电子邮件,虽然OK状态:(
#3
0
You may refer on these links to have your IP address remove from Hotmail black list
您可以参考这些链接,从Hotmail黑名单中删除您的IP地址