From 8b91975fa5237652ba93a6deb721d2115e2e1262 Mon Sep 17 00:00:00 2001 From: Andrew Stadler Date: Thu, 17 Sep 2009 23:47:00 -0700 Subject: [PATCH] Clean up transport encryption & port options * Remove SSL-Optional and TLS-Optional choices from UI * Remove SSL-Optional and TLS-Optional choices from providers.xml * Switch over most SMTP connections from 25 to 587 * Clean up the providers list which has a lot of "optional" cases that were probably falling back to unencrypted. Fixes bugs: 2110243 Settings UI shouldn't offer SSL/TLS (if available) options 2089070 Update list of providers Change-Id: I57be57b349eed33a5284121d904528279a36a91c --- res/xml/providers.xml | 40 +++++++++---------- .../activity/setup/AccountSetupIncoming.java | 18 ++++----- .../activity/setup/AccountSetupOutgoing.java | 12 ++---- 3 files changed, 31 insertions(+), 39 deletions(-) diff --git a/res/xml/providers.xml b/res/xml/providers.xml index 44232820f..148308316 100644 --- a/res/xml/providers.xml +++ b/res/xml/providers.xml @@ -51,32 +51,29 @@ Valid incoming uri schemes are: imap IMAP with no transport security. - imap+tls IMAP with optional TLS transport security. - If TLS is not available the connection is made as "imap" imap+tls+ IMAP with required TLS transport security. - If TLS is not available the conneciton fails. + If TLS is not available the connection fails. imap+ssl+ IMAP with required SSL transport security. If SSL is not available the connection fails. pop3 POP3 with no transport security. - pop3+tls POP3 with optional TLS transport security. - If TLS is not available the connection is made as "pop3" pop3+tls+ POP3 with required TLS transport security. - If TLS is not available the conneciton fails. + If TLS is not available the connection fails. pop3+ssl+ POP3 with required SSL transport security. If SSL is not available the connection fails. Valid outgoing uri schemes are: smtp SMTP with no transport security. - smtp+tls SMTP with optional TLS transport security. - If TLS is not available the connection is made as "smtp" smtp+tls+ SMTP with required TLS transport security. - If TLS is not available the conneciton fails. + If TLS is not available the connection fails. smtp+ssl+ SMTP with required SSL transport security. If SSL is not available the connection fails. The URIs should be full templates for connection, including a port if - the service uses a non-default port. + the service uses a non-default port. The default ports are as follows: + imap 143 pop3 110 smtp 587 + imap+tls+ 143 pop3+tls+ 110 smtp+tls+ 587 + imap+ssl+ 993 pop3+ssl+ 995 smtp+ssl+ 465 The username attribute is used to supply a template for the username that will be presented to the server. This username is built from a @@ -118,11 +115,11 @@ - + - + @@ -136,9 +133,10 @@ + - - + + @@ -163,9 +161,11 @@ + + - - + + @@ -204,8 +204,8 @@ - - + + @@ -213,8 +213,8 @@ - - + + diff --git a/src/com/android/email/activity/setup/AccountSetupIncoming.java b/src/com/android/email/activity/setup/AccountSetupIncoming.java index 2cdccfc20..24ae3e667 100644 --- a/src/com/android/email/activity/setup/AccountSetupIncoming.java +++ b/src/com/android/email/activity/setup/AccountSetupIncoming.java @@ -46,16 +46,16 @@ public class AccountSetupIncoming extends Activity implements OnClickListener { private static final String EXTRA_MAKE_DEFAULT = "makeDefault"; private static final int popPorts[] = { - 110, 995, 995, 110, 110 + 110, 995, 110 }; private static final String popSchemes[] = { - "pop3", "pop3+ssl", "pop3+ssl+", "pop3+tls", "pop3+tls+" + "pop3", "pop3+ssl+", "pop3+tls+" }; private static final int imapPorts[] = { - 143, 993, 993, 143, 143 + 143, 993, 143 }; private static final String imapSchemes[] = { - "imap", "imap+ssl", "imap+ssl+", "imap+tls", "imap+tls+" + "imap", "imap+ssl+", "imap+tls+" }; private final static int DIALOG_DUPLICATE_ACCOUNT = 1; @@ -109,13 +109,9 @@ public class AccountSetupIncoming extends Activity implements OnClickListener { mNextButton.setOnClickListener(this); SpinnerOption securityTypes[] = { - new SpinnerOption(0, getString(R.string.account_setup_incoming_security_none_label)), - new SpinnerOption(1, - getString(R.string.account_setup_incoming_security_ssl_optional_label)), - new SpinnerOption(2, getString(R.string.account_setup_incoming_security_ssl_label)), - new SpinnerOption(3, - getString(R.string.account_setup_incoming_security_tls_optional_label)), - new SpinnerOption(4, getString(R.string.account_setup_incoming_security_tls_label)), + new SpinnerOption(0, getString(R.string.account_setup_incoming_security_none_label)), + new SpinnerOption(1, getString(R.string.account_setup_incoming_security_ssl_label)), + new SpinnerOption(2, getString(R.string.account_setup_incoming_security_tls_label)), }; SpinnerOption deletePolicies[] = { diff --git a/src/com/android/email/activity/setup/AccountSetupOutgoing.java b/src/com/android/email/activity/setup/AccountSetupOutgoing.java index e3c80ab18..510fbaf7a 100644 --- a/src/com/android/email/activity/setup/AccountSetupOutgoing.java +++ b/src/com/android/email/activity/setup/AccountSetupOutgoing.java @@ -48,11 +48,11 @@ public class AccountSetupOutgoing extends Activity implements OnClickListener, private static final String EXTRA_MAKE_DEFAULT = "makeDefault"; private static final int smtpPorts[] = { - 25, 465, 465, 25, 25 + 587, 465, 587 }; private static final String smtpSchemes[] = { - "smtp", "smtp+ssl", "smtp+ssl+", "smtp+tls", "smtp+tls+" + "smtp", "smtp+ssl+", "smtp+tls+" }; private EditText mUsernameView; @@ -101,12 +101,8 @@ public class AccountSetupOutgoing extends Activity implements OnClickListener, SpinnerOption securityTypes[] = { new SpinnerOption(0, getString(R.string.account_setup_incoming_security_none_label)), - new SpinnerOption(1, - getString(R.string.account_setup_incoming_security_ssl_optional_label)), - new SpinnerOption(2, getString(R.string.account_setup_incoming_security_ssl_label)), - new SpinnerOption(3, - getString(R.string.account_setup_incoming_security_tls_optional_label)), - new SpinnerOption(4, getString(R.string.account_setup_incoming_security_tls_label)), + new SpinnerOption(1, getString(R.string.account_setup_incoming_security_ssl_label)), + new SpinnerOption(2, getString(R.string.account_setup_incoming_security_tls_label)), }; ArrayAdapter securityTypesAdapter = new ArrayAdapter(this,