Rocco Rutte:
[apps/madmutt.git] / pop / pop_lib.c
index 9e7d4e4..024cbdc 100644 (file)
@@ -262,7 +262,9 @@ pop_query_status pop_open_connection (POP_DATA * pop_data)
 
 #if (defined(USE_SSL) || defined(USE_GNUTLS))
   /* Attempt STLS if available and desired. */
-  if (pop_data->cmd_stls && !pop_data->conn->ssf) {
+  if (!pop_data->conn->ssf && (pop_data->cmd_stls || option(OPTSSLFORCETLS))) {
+    if (option (OPTSSLFORCETLS))
+      pop_data->use_stls = 2;
     if (pop_data->use_stls == 0) {
       ret = query_quadoption (OPT_SSLSTARTTLS,
                               _("Secure connection with TLS?"));
@@ -303,6 +305,12 @@ pop_query_status pop_open_connection (POP_DATA * pop_data)
       }
     }
   }
+
+  if (option(OPTSSLFORCETLS) && !pop_data->conn->ssf) {
+    mutt_error _("Encrypted connection unavailable");
+    mutt_sleep (1);
+    return -2;
+  }
 #endif
 
   ret = pop_authenticate (pop_data);