aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-03-06 21:09:16 +0800
committerMilan Crha <mcrha@redhat.com>2012-03-06 21:09:16 +0800
commitb8b0613be4d0ef40c91c1b82b3d1116cd289b64e (patch)
tree1b191fa8e57e3a48e3c3013653f521671f236339 /widgets/misc
parentdfa6774330372a3665019d9d3def7d7901aa038d (diff)
downloadgsoc2013-evolution-b8b0613be4d0ef40c91c1b82b3d1116cd289b64e.tar
gsoc2013-evolution-b8b0613be4d0ef40c91c1b82b3d1116cd289b64e.tar.gz
gsoc2013-evolution-b8b0613be4d0ef40c91c1b82b3d1116cd289b64e.tar.bz2
gsoc2013-evolution-b8b0613be4d0ef40c91c1b82b3d1116cd289b64e.tar.lz
gsoc2013-evolution-b8b0613be4d0ef40c91c1b82b3d1116cd289b64e.tar.xz
gsoc2013-evolution-b8b0613be4d0ef40c91c1b82b3d1116cd289b64e.tar.zst
gsoc2013-evolution-b8b0613be4d0ef40c91c1b82b3d1116cd289b64e.zip
Bug #671233 - Unable to choose port 587 for SMTP
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/e-port-entry.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/widgets/misc/e-port-entry.c b/widgets/misc/e-port-entry.c
index cc90302771..84a514b653 100644
--- a/widgets/misc/e-port-entry.c
+++ b/widgets/misc/e-port-entry.c
@@ -114,9 +114,9 @@ port_entry_method_changed (EPortEntry *port_entry)
{
CamelNetworkSecurityMethod method;
gboolean standard_port = FALSE;
- gboolean valid;
+ gboolean valid, have_ssl = FALSE, have_nossl = FALSE;
gint port = 0;
- gint ii = 0;
+ gint ii;
method = e_port_entry_get_security_method (port_entry);
valid = port_entry_get_numeric_port (port_entry, &port);
@@ -126,12 +126,23 @@ port_entry_method_changed (EPortEntry *port_entry)
* leave custom port numbers alone. */
if (valid && port_entry->priv->entries != NULL) {
- while (port_entry->priv->entries[ii].port > 0) {
+ for (ii = 0; port_entry->priv->entries[ii].port > 0 && (!have_ssl || !have_nossl); ii++) {
+ /* Use only the first SSL/no-SSL port as a default in the list
+ and skip the others */
+ if (port_entry->priv->entries[ii].is_ssl) {
+ if (have_ssl)
+ continue;
+ have_ssl = TRUE;
+ } else {
+ if (have_nossl)
+ continue;
+ have_nossl = TRUE;
+ }
+
if (port == port_entry->priv->entries[ii].port) {
standard_port = TRUE;
break;
}
- ii++;
}
}