Technically, this is incorrect:
A direct TLS-only SMTP service is against the standards,
and a "_submission._tcp" SRV record should have a port
that has a plaintext+STARTTLS service listening
(RFC 6186, section 3.1).
Port 465 shouldn't even be used for mail submission of
any kind, according to IANA:
(https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=465)
However, everyone ignores that, and port 465 is routinely
used for TLS-only SMTP service, and therefore it is safe to
assume direct TLS instead of STARTTLS.
#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
static void auto_configure_done(const gchar *hostname, gint port, gboolean ssl, AutoConfigureData *data)
{
#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
static void auto_configure_done(const gchar *hostname, gint port, gboolean ssl, AutoConfigureData *data)
{
+ gboolean smtp = strcmp(data->tls_service, "submission") == 0 ? TRUE : FALSE;
+
if (hostname != NULL) {
if (data->hostname_entry)
gtk_entry_set_text(data->hostname_entry, hostname);
if (hostname != NULL) {
if (data->hostname_entry)
gtk_entry_set_text(data->hostname_entry, hostname);
/* Wizard where TLS is [x]SSL + [x]TLS */
gtk_toggle_button_set_active(data->ssl_checkbtn, TRUE);
}
/* Wizard where TLS is [x]SSL + [x]TLS */
gtk_toggle_button_set_active(data->ssl_checkbtn, TRUE);
}
- gtk_toggle_button_set_active(data->tls_checkbtn, TRUE);
+
+ /* Even though technically this is against the RFCs,
+ * if a "_submission._tcp" SRV record uses port 465,
+ * it is safe to assume TLS-only service, instead of
+ * plaintext + STARTTLS one. */
+ if (smtp && port == 465)
+ gtk_toggle_button_set_active(data->ssl_checkbtn, TRUE);
+ else
+ gtk_toggle_button_set_active(data->tls_checkbtn, TRUE);
}
/* Check authentication by default. This is probably required if
}
/* Check authentication by default. This is probably required if
send_data->set_port = GTK_TOGGLE_BUTTON(advanced_page.smtpport_checkbtn);
send_data->port = GTK_SPIN_BUTTON(advanced_page.smtpport_spinbtn);
send_data->tls_checkbtn = GTK_TOGGLE_BUTTON(ssl_page.smtp_starttls_radiobtn);
send_data->set_port = GTK_TOGGLE_BUTTON(advanced_page.smtpport_checkbtn);
send_data->port = GTK_SPIN_BUTTON(advanced_page.smtpport_spinbtn);
send_data->tls_checkbtn = GTK_TOGGLE_BUTTON(ssl_page.smtp_starttls_radiobtn);
- send_data->ssl_checkbtn = NULL;
+ send_data->ssl_checkbtn = GTK_TOGGLE_BUTTON(ssl_page.smtp_ssltunnel_radiobtn);
send_data->default_port = 25;
send_data->default_ssl_port = -1;
send_data->uid_entry = NULL;
send_data->default_port = 25;
send_data->default_ssl_port = -1;
send_data->uid_entry = NULL;