3.2.4 fails after READY TO START TLS

It seems that all goes well until phplist receives the READY TO START TLS command from our Mail Server. I am trying to determine if it is a phplist configuration problem or a mail server problem. Would appreciate help from any SMTP specialists out there as we have been unable to send any mail for almost 2 weeks now.

Thanks - Doug

@Dougster Did you make the change that I suggested Unable to send after upgrade to 3.2.4

Yes, I tried that both true and false. I’ve tried to set it to use SSL or TLS. Neither will fully enter into the TLS handshake correctly. It always disconnects after the 2.0.0 Ready to start TLS.

This is very frustrating since I’ve had it running for years but PCI Compliance has changed what is/is not allowed on mail servers.

If the mail server supports TLS then these settings should work

define('PHPMAILERPORT',587);
define("PHPMAILER_SECURE",'tls');

I finally read the detailed docs at GitHub and it explained how to test if your mail server properly handles TLS … ERROR … it doesn’t. So, with that in mind, shut it all down and use CRAM-MD5 for the password and POOF, it works. Thanks to all who helped provide little steps towards the ultimate solution.

@duncanc @Dougster Hello guys.

It seems I’m having the same problem but not under the same circumstances.
I’ve installed a fresh copy of PHPList (v3.2.4) in one server running NGinx 1.6.2 and PHP 5.6.9-0 on Debian.

I’m using another PHPList (v3.0.5) for production in another server with Apache 2.2.22 and PHP 5.4.4-14 and it works fantastic.

Now, in both installs I’m using an external SMTP address (an internal Sendmail server from work), and this is important, the SMTP server is listening on port 25 with NO ssl/tls enabled, in fact with NO auth at all. In the old install keeps working normally, but in the new install I have the same problem of @Dougster , I’m getting stucked at READY TO START TLS.

Here goes the logPaste:

Connection: opening to relay.mailsender.com:25, timeout=5, options=array ()
Connection: opened
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "220 relay.mailsender.com ESMTP Sendmail 8.13.1/8.13.1; Thu, 14 Apr 2016 18:30:09 -0300"
SERVER -> CLIENT: 220 relay.mailsender.com ESMTP Sendmail 8.13.1/8.13.1; Thu, 14 Apr 2016 18:30:09 -0300
CLIENT -> SERVER: EHLO phplistapp.server.com
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you"
SMTP -> get_lines(): $data is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you"
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $data is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you250-ENHANCEDSTATUSCODES"
SMTP -> get_lines(): $str is "250-PIPELINING"
SMTP -> get_lines(): $data is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING"
SMTP -> get_lines(): $str is "250-8BITMIME"
SMTP -> get_lines(): $data is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME"
SMTP -> get_lines(): $str is "250-SIZE 30000000"
SMTP -> get_lines(): $data is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE 30000000"
SMTP -> get_lines(): $str is "250-DSN"
SMTP -> get_lines(): $data is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE 30000000250-DSN"
SMTP -> get_lines(): $str is "250-ETRN"
SMTP -> get_lines(): $data is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE 30000000250-DSN250-ETRN"
SMTP -> get_lines(): $str is "250-AUTH DIGEST-MD5 CRAM-MD5"
SMTP -> get_lines(): $data is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE 30000000250-DSN250-ETRN250-AUTH DIGEST-MD5 CRAM-MD5"
SMTP -> get_lines(): $str is "250-STARTTLS"
SMTP -> get_lines(): $data is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE 30000000250-DSN250-ETRN250-AUTH DIGEST-MD5 CRAM-MD5250-STARTTLS"
SMTP -> get_lines(): $str is "250-DELIVERBY"
SMTP -> get_lines(): $data is "250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE 30000000250-DSN250-ETRN250-AUTH DIGEST-MD5 CRAM-MD5250-STARTTLS250-DELIVERBY"
SMTP -> get_lines(): $str is "250 HELP"
SERVER -> CLIENT: 250-relay.mailsender.com Hello phplistapp.server.com [192.168.1.10], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE 30000000250-DSN250-ETRN250-AUTH DIGEST-MD5 CRAM-MD5250-STARTTLS250-DELIVERBY250 HELP
CLIENT -> SERVER: STARTTLS
SMTP -> get_lines(): $data is ""
SMTP -> get_lines(): $str is "220 2.0.0 Ready to start TLS"
SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
SMTP Error: Could not connect to SMTP host.
CLIENT -> SERVER: QUIT
SMTP -> get_lines(): $data is ""

Connection: closed
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

I have full access to both PHPList servers but not to the SMTP server to test.

I will take all the help I can get.
Thanks in advance!

@Eyemaster The smtp processing is done by the phpmailer package. phplist uses a more recent version of that in 3.2.4.

You can try using the phpmailer version included in phplist 3.0.9. Just copy the admin/PHPMailer directory and subdirectories to your phplist 3.2.4 installation.

My fix was to switch to the SSL port for the admin messages since it defaults to that no matter what you have set in the config.php. Here is a link to the tool DUNCANC had me add to the admin mail area. It allowed me to debug the admin message creation.

Good luck getting this all working.

Doug

@duncanc / @Dougster Hello guys!

The problem is solved!
I took the advice of @duncanc and replaced the /admin/PHPMailer folder from PHPList 3.0.9 and voilá.
Mails are sending OK and all it works like a charm.

Thanks to both of you for your help & quick response!

Regards from Argentina.
Germán.

This solution has just worked for me again after upgrading to 3.3.3.

I applied it successfully once when I upgraded from 3.0.9. Now I upgraded a second time to 3.3.3 and SMTP stopped working again. Debugging shows the same negotiation and failure posted by Eyemaster. I replaced again the default PHPmailer, shipped with PHPlist 3.3.3, with the one found in 3.0.9. And the system is fixed.

Adding some configuration details for anyone who will arrive here after googling for a solution to the broken SMTP connection. :slight_smile:

My MTA is Qmail. Connection is local, with the following variable set:
define(“PHPMAILERHOST”, ‘localhost’);

The following variables are set:
$phpmailer_smtpuser = ‘…’;
$phpmailer_smtppassword = ‘…’;

The following variables are commented, because debugging shows that PHPlist can negotiate these values with the MTA:
//define(‘PHPMAILERPORT’, 25);
//define(“PHPMAILER_SECURE”,‘’);

December 2019: I just found this discussion while googling for the SMTP connection issue. After upgrading Phplist, suddenly SMTP stops working. Applied the solution, that is, replace the Phpmailer directory with the one from 3.0.9 + edit some config values, and it works.

Especially “define(‘PHPMAILERHOST’, ‘localhost’);” is tricky. If I write the full hostname of the mail server, the connection won’t be established.

Logging in just to thank the poster and… it was me, 1,5 years ago. :sweat_smile:

Looks like I should note this down somewhere. :rofl:

2 Likes

That’s exactly why forums like this one exist :wink:

Mariana