Fix STARTTLS handshake error in Email's SmtpSender class

The Email.apk checks for "-STARTTLS" in the SMTP server's EHLO response
but SMTP servers may respond with STARTTLS on the last line as such:

250 STARTTLS

Or even as part of a line as such:

250-XSECURITY=NONE,STARTTLS

Checking for "-STARTTLS" in this case will break. The fix is to simply check
for "STARTTLS" instead.

See http://code.google.com/p/android/issues/detail?id=19109
And http://code.google.com/p/android/issues/detail?id=2309

Change-Id: I3a590a4398cb664f46875650550986a67f320f76
This commit is contained in:
Misha Nasledov 2012-02-29 03:15:10 -08:00
parent e3def6c9c4
commit c31e2555bf
1 changed files with 1 additions and 1 deletions

View File

@ -136,7 +136,7 @@ public class SmtpSender extends Sender {
* if not.
*/
if (mTransport.canTryTlsSecurity()) {
if (result.contains("-STARTTLS")) {
if (result.contains("STARTTLS")) {
executeSimpleCommand("STARTTLS");
mTransport.reopenTls();
/*