]> code.citadel.org Git - citadel.git/commitdiff
* Support POP3 over TLS
authorArt Cancro <ajc@citadel.org>
Mon, 16 Feb 2004 21:54:22 +0000 (21:54 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 16 Feb 2004 21:54:22 +0000 (21:54 +0000)
citadel/ChangeLog
citadel/serv_pop3.c
citadel/serv_smtp.c

index 26f0ffc82647090345bd50e7b83e0e450d849d69..a5b577d207d41a0143caf71bd6e32919fe150085 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 614.38  2004/02/16 21:54:22  ajc
+ * Support POP3 over TLS
+
  Revision 614.37  2004/02/16 21:45:43  ajc
  * Implement RFC 2487 - SMTP Service Extension for Secure SMTP over TLS
 
@@ -5353,3 +5356,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index e0adfa0a41dd4771d706a01db763cfeb3ca44465..86ad7fc5484f97559a374fa78f98536b18eae01d 100644 (file)
 #include "serv_pop3.h"
 #include "md5.h"
 
+#ifdef HAVE_OPENSSL
+#include "serv_crypto.h"
+#endif
+
+
 
 /*
  * This cleanup function blows away the temporary memory and files used by
@@ -528,6 +533,30 @@ void pop3_uidl(char *argbuf) {
 }
 
 
+/*
+ * implements the STLS command (Citadel API version)
+ */
+#ifdef HAVE_OPENSSL
+void pop3_stls(void)
+{
+       char ok_response[SIZ];
+       char nosup_response[SIZ];
+       char error_response[SIZ];
+
+       sprintf(ok_response,
+               "+OK Begin TLS negotiation now\r\n");
+       sprintf(nosup_response,
+               "-ERR TLS not supported here\r\n");
+       sprintf(error_response,
+               "-ERR Internal error\r\n");
+       CtdlStartTLS(ok_response, nosup_response, error_response);
+}
+#endif
+
+
+
+
+
 
 
 /* 
@@ -570,6 +599,12 @@ void pop3_command_loop(void) {
                pop3_apop(&cmdbuf[5]);
        }
 
+#ifdef HAVE_OPENSSL
+       else if (!strncasecmp(cmdbuf, "STLS", 4)) {
+               pop3_stls();
+       }
+#endif
+
        else if (!CC->logged_in) {
                cprintf("-ERR Not logged in.\r\n");
        }
index f4b50016b30704df1b824baf0d7bd88d7fd64538..b589493028166608c01ac7e1abd8db4de008b7d5 100644 (file)
@@ -705,8 +705,6 @@ void smtp_command_loop(void) {
        lprintf(5, "SMTP: %s\n", cmdbuf);
        while (strlen(cmdbuf) < 5) strcat(cmdbuf, " ");
 
-       lprintf(9, "CC->logged_in = %d\n", CC->logged_in);
-
        if (SMTP->command_state == smtp_user) {
                smtp_get_user(cmdbuf);
        }