简体   繁体   English

PHP Zend - 连接到 SMTP 超时

[英]PHP Zend - Connect to SMTP timeout

Good day to all.祝大家有美好的一天。

I have the following problem:我有以下问题:

I have a cron that sends a request to a script that sends some mails using zend mailer.我有一个 cron 向使用 zend 邮件程序发送一些邮件的脚本发送请求。

On the test machine it worked without any problems.在测试机器上它工作没有任何问题。 The problem is that on the production machine I get the following error:问题是在生产机器上我收到以下错误:

xception 'Zend_Mail_Protocol_Exception' with message 'Connection timed out' in /var/www/html/site/include/Zend/Mail/Protocol/Abstract.php:254
Stack trace:
#0 /var/www/html/bca/include/Zend/Mail/Protocol/Smtp.php(167): Zend_Mail_Protocol_Abstract->_connect('tcp://182.19.13...')
#1 /var/www/html/bca/include/Zend/Mail/Transport/Smtp.php(199): Zend_Mail_Protocol_Smtp->connect()
#2 /var/www/html/bca/include/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
#3 /var/www/html/bca/include/Zend/Mail.php(1178): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#4 /var/www/html/bca/include/DatabaseObject/Newsletter.php(249): Zend_Mail->send()
#5 /var/www/html/bca/include/Controllers/NewsletterController.php(551): DatabaseObject_Newsletter->sendEmail('', 'f04e3ae3586c39f...')
#6 /var/www/html/bca/include/Zend/Controller/Action.php(513): NewsletterController->processAction()
#7 /var/www/html/bca/include/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('processAction')
#8 /var/www/html/bca/include/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#9 /var/www/html/bca/public_html/index.php(660): Zend_Controller_Front->dispatch()

The cron that I run is:我运行的 cron 是:

wget -O - -t 1 https://www.site.ro/newsletter/process --no-check-certificate wget -O - -t 1 https://www.site.ro/newsletter/process --no-check-certificate

or, similar,或者,类似的,

wget -O - -t 1 http://www.site.ro/newsletter/process wget -O - -t 1 http://www.site.ro/newsletter/process

First time when I received the problem I told them to check the SMTP configurations, but the ppl.第一次收到问题时,我告诉他们检查 SMTP 配置,但 ppl. that did the configuration insist that the configuration is OK.那个配置坚持认为配置没问题。 So... I don't know.所以……我不知道。 It seems like a lack of connectivity but they still insist is OK.似乎缺乏连接,但他们仍然坚持认为没问题。 Any help pls.?有什么帮助吗?

Well... I don't know what they did... but now they get this:嗯......我不知道他们做了什么......但现在他们得到了这个:

exception 'Zend_Mail_Protocol_Exception' with message '5.3.3 AUTH mechanism LOGIN not     available ' in /var/www/html/bca/include/Zend/Mail/Protocol/Abstract.php:408 Stack     trace:
#0 /var/www/html/bca/include/Zend/Mail/Protocol/Smtp/Auth/Login.php(91): Zend_Mail_Protocol_Abstract->_expect(334) 
#1 /var/www/html/bca/include/Zend/Mail/Protocol/Smtp.php(217): Zend_Mail_Protocol_Smtp_Auth_Login->auth() 
#2 /var/www/html/bca/include/Zend/Mail/Transport/Smtp.php(200): Zend_Mail_Protocol_Smtp->helo('localhost') 
#3 /var/www/html/bca/include/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail() 
#4 /var/www/html/bca/include/Zend/Mail.php(1178): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail)) 
#5 /var/www/html/bca/include/DatabaseObject/Newsletter.php(249): Zend_Mail->send() 
#6 /var/www/html/bca/include/Controllers/NewsletterController.php(551): DatabaseObject_Newsletter->sendEmail('', 'f04e3ae3586c39f...') 
#7 /var/www/html/bca/include/Zend/Controller/Action.php(513): NewsletterController->processAction() 
#8 /var/www/html/bca/include/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('processAction') 
#9 /var/www/html/bca/include/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) 
#10 /var/www/html/bca/public_html/index.php(660): Zend_Controller_Front->dispatch() 
#11 {main}

I suggested to check user/pass... for the 7th time... they still say is ok.我建议第七次检查用户/通行证...他们仍然说没问题。

I would verify that the SMTP can be contacted from your production server by running the following from a command prompt on the server:我将验证 SMTP 可以通过从服务器上的命令提示符运行以下命令从您的生产服务器联系:

$ telnet 1.2.3.4 25

Where 1.2.3.4 is the IP address or hostname of the SMTP server you're trying to connect to.其中 1.2.3.4 是您尝试连接的 SMTP 服务器的 IP 地址或主机名。 From the exception it looks like this address starts 182.19.13...从异常看来,这个地址从182.19.13...

When you run the command you should see something like:当您运行命令时,您应该会看到如下内容:

Connected to foo.
Escape character is '^]'.
220 foo ESMTP Postfix (Ubuntu)

If you don't see something similar to that please post up the output/error如果您没有看到类似的内容,请发布输出/错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM