I have reviewed posts that are relevant to my case - no joy.
In short - emails notifications have been working fine until August. I'm not sure what happened (maybe system update have broken something...) however I cannot establish a ssl connection with smtp.gmail.comn any more.
I have reviewed host name, port, user name, password etc. and tried different configurations suggested on this forum - unsuccessfully.
I have turned iptables off - no success.
I'm starting to think that maybe disable_functions is the case?
I would appreciate your help.
Details of my system:
Mantis 1.2.17 running on Arch Linux 3.16.4-1-ARCH x86-64
Web stack based on NginX (1.6.2) and php(5.6.2)
In php.ini I'm disabling following functions:
disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
I have tried to troubleshoot this by writing simple test_email.php (with that I could connect to the server), here it is below:
Code: Select all
<?php
echo("<p>start</p>");
require_once "library/phpmailer/class.smtp.php";
$from = "xxx@gmail.com";
$to = "xxx@yahoo.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "smtp.gmail.com";
//$port = "587";
$port = "465";
$username = "xxx@gmail.com";
$password = "xxx";
$headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject);
echo("create smtp object<br />");
$smtp = new smtp();
$smtp->Debugoutput = 'echo';
$smtp->do_debug = 55;
echo("connect<br />");
try
{
$smtp->Connect($host, $port);
}
catch (Exception $e)
{
echo ('Caught exception: ' . $e->getMessage() . "<br />");
}
echo("helo<br />");
try
{
$smtp->Hello($host);
}
catch (Exception $e)
{
echo ('Caught exception: ' . $e->getMessage() . "<br />");
}
/*
echo("starttls<br />");
try
{
$smtp->StartTLS();
}
catch (Exception $e)
{
echo ('Caught exception: ' . $e->getMessage() . "<br />");
}
*/
echo("authenticate<br />");
try
{
$smtp->Authenticate($username, $password);
}
catch (Exception $e)
{
echo ('Caught exception: ' . $e->getMessage() . "<br />");
}
if ( $smtp->Connected() )
{
echo("connected<br />");
}
else
{
echo("error!<br />");
}
echo("close<br />");
$smtp->Close();
echo("closed<br />");
?>
Code: Select all
start
create smtp object
connect
SMTP -> ERROR: Failed to connect to server: Connection timed out (110)
authenticate
CLIENT -> SMTP: AUTH LOGIN
SMTP -> ERROR: AUTH not accepted from server:
error!
close
closed
Code: Select all
openssl s_client -connect smtp.gmail.com:465
Code: Select all
SMTP -> ERROR: AUTH not accepted from server: >>some binary<<
Code: Select all
start
create smtp object
connect
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "220 mx.google.com ESMTP ei1sm2226014wib.20 - gsmtp "
SMTP -> get_lines(): $data is "220 mx.google.com ESMTP ei1sm2226014wib.20 - gsmtp "
SMTP -> FROM SERVER:220 mx.google.com ESMTP ei1sm2226014wib.20 - gsmtp
helo
CLIENT -> SMTP: EHLO smtp.gmail.com
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] "
SMTP -> get_lines(): $data is "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] "
SMTP -> get_lines(): $data was "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] "
SMTP -> get_lines(): $str is "250-SIZE 35882577 "
SMTP -> get_lines(): $data is "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 "
SMTP -> get_lines(): $data was "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 "
SMTP -> get_lines(): $str is "250-8BITMIME "
SMTP -> get_lines(): $data is "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME "
SMTP -> get_lines(): $data was "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME "
SMTP -> get_lines(): $str is "250-STARTTLS "
SMTP -> get_lines(): $data is "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS "
SMTP -> get_lines(): $data was "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS "
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES "
SMTP -> get_lines(): $data is "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES "
SMTP -> get_lines(): $data was "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES "
SMTP -> get_lines(): $str is "250-PIPELINING "
SMTP -> get_lines(): $data is "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING "
SMTP -> get_lines(): $data was "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING "
SMTP -> get_lines(): $str is "250-CHUNKING "
SMTP -> get_lines(): $data is "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING "
SMTP -> get_lines(): $data was "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING "
SMTP -> get_lines(): $str is "250 SMTPUTF8 "
SMTP -> get_lines(): $data is "250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 "
SMTP -> FROM SERVER: 250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8
starttls
CLIENT -> SMTP: STARTTLS
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "220 2.0.0 Ready to start TLS "
SMTP -> get_lines(): $data is "220 2.0.0 Ready to start TLS "
SMTP -> FROM SERVER:220 2.0.0 Ready to start TLS
authenticate
CLIENT -> SMTP: AUTH LOGIN
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is ">>binary<<"
SMTP -> get_lines(): $data is ">>binary<<"
SMTP -> get_lines(): $data was ">>binary<<"
SMTP -> get_lines(): $str is ">>binary<<"
SMTP -> get_lines(): $data is ">>binary<<"
SMTP -> ERROR: AUTH not accepted from server: >>binary<<
SMTP -> NOTICE: EOF caught while checking if connectederror!
close
closed