Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add bare-bones STARTTLS support to IMAP #1714
Reported by chugadie on 19 Aug 2008 15:07 UTC as Trac ticket #1485284
This isn't very good, but it gets the job done. Adds starttls support to the iil_Connect function in program/lib/imap.inc This patch could add some more error handling, and maybe section off the actual stream_* php-5 methods into another function in the imap lib file.
Comment by chugadie on 10 Sep 2008 13:33 UTC
The problem with changeset 1031 is that it only distinguishes the name tls from ssl. The names are practically synonymous with each other, I only used the distinction as a flag for the rest of the "STARTTLS" command functionality. Changeset 1031 would help the configurations remain separate, but it is not full "STARTTLS" functionality.
Some IMAP servers (like mine) don't encrypt the entire TCP connection, but they do start and SSL handshake when they receive the command STARTTLS. (Capabilities for this are specified by EHLO)
My patch looks for the STARTTLS capability and tries to send the STARTTLS command when the configuration parameter is "tls" as opposed to "ssl" (I just invented the difference between those two for my own settings and testing. Then the patch uses PHP5's socket encryption techniques to encrypt the remainder of the IMAP conversation.
Comment by ali on 14 Apr 2009 01:26 UTC
While facing the same STARTTLS issue, I've found on dev list''',,![that Francis Russell has submitted a patch for the same purpose.
Maybe STARTTLS support could be now part of trunk?