简体   繁体   中英

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.

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:

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

First time when I received the problem I told them to check the SMTP configurations, but the 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:

$ 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. From the exception it looks like this address starts 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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