9e566a4
--- imap/imapd.c
9e566a4
+++ imap/imapd.c	2004/01/16 12:25:51
9e566a4
@@ -578,8 +578,11 @@
9e566a4
 	fatal("SASL failed initializing: sasl_server_new()", EC_TEMPFAIL);
9e566a4
     }
9e566a4
 
9e566a4
-    /* never allow plaintext, since IMAP has the LOGIN command */
9e566a4
-    secprops = mysasl_secprops(SASL_SEC_NOPLAINTEXT);
9e566a4
+    if( (config_getswitch(IMAPOPT_ALLOWPLAINWITHOUTTLS) == 0) ) {
9e566a4
+        secprops = mysasl_secprops(SASL_SEC_NOPLAINTEXT);
9e566a4
+    } else {
9e566a4
+        secprops = mysasl_secprops(0);
9e566a4
+    }
9e566a4
     sasl_setprop(imapd_saslconn, SASL_SEC_PROPS, secprops);
9e566a4
     sasl_setprop(imapd_saslconn, SASL_SSF_EXTERNAL, &extprops_ssf);
9e566a4
 
9e566a4
--- lib/imapoptions
9e566a4
+++ lib/imapoptions	2004/01/16 12:27:52
9e566a4
@@ -684,6 +684,9 @@
9e566a4
    to set this to yes, especially if OpenLDAP is used as authentication
9e566a4
    source. */
9e566a4
 
9e566a4
+{ "allowplainwithouttls", 0, SWITCH }
9e566a4
+/* Allow plain login mechanism without an encrypted connection. */
9e566a4
+
9e566a4
 /*
9e566a4
 .SH SEE ALSO
9e566a4
 .PP