Rocco Rutte:
[apps/madmutt.git] / pop / pop_lib.c
index 637d01b..024cbdc 100644 (file)
@@ -260,9 +260,11 @@ pop_query_status pop_open_connection (POP_DATA * pop_data)
     return PQ_ERR;
   }
 
-#if (defined(USE_SSL) || defined(USE_GNUTLS)) && !defined(USE_NSS)
+#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);
@@ -484,7 +492,7 @@ static int check_uidl (char *line, void *data)
 
   sscanf (line, "%u %s", &index, line);
   for (i = 0; i < ctx->msgcount; i++) {
-    if (!safe_strcmp (ctx->hdrs[i]->data, line)) {
+    if (!mutt_strcmp (ctx->hdrs[i]->data, line)) {
       ctx->hdrs[i]->refno = index;
       break;
     }