Included below is a patch to support RFC 2449, the POP3 CAPA command.

-- 
Ryan Butler <[EMAIL PROTECTED]>
ADI Internet Solutions
http://dbmail.adiis.net

diff -ur dbmail/pop3.c dbmail.working/pop3.c
--- dbmail/pop3.c	Wed Jun 19 05:39:48 2002
+++ dbmail.working/pop3.c	Tue Nov 12 11:09:02 2002
@@ -29,7 +29,7 @@
 const char *commands [] = 
 {
   "quit", "user", "pass", "stat", "list", "retr", "dele", "noop", "last", "rset",
-  "uidl","apop","auth","top"
+  "uidl","apop","auth","top","capa"
 };
 
 const char validchars[] = 
@@ -112,7 +112,7 @@
   /* commands that are allowed to have no arguments */
   if ((value==NULL) && (cmdtype!=POP3_QUIT) && (cmdtype!=POP3_LIST) &&
       (cmdtype!=POP3_STAT) && (cmdtype!=POP3_RSET) && (cmdtype!=POP3_NOOP) &&
-      (cmdtype!=POP3_LAST) && (cmdtype!=POP3_UIDL) && (cmdtype!=POP3_AUTH)) 
+      (cmdtype!=POP3_LAST) && (cmdtype!=POP3_UIDL) && (cmdtype!=POP3_AUTH) && (cmdtype!=POP3_CAPA)) 
     {
       return pop3_error(stream,"-ERR your command does not compute\r\n");
     }
@@ -541,6 +541,11 @@
 	return 1;
       }
 
+    case POP3_CAPA:
+      {
+        fprintf ((FILE *)stream, "+OK Capability list follows\r\nTOP\r\nUSER\r\nUIDL\r\n.\r\n");
+        return 1;
+      }
     default : 
       {
 	return pop3_error(stream,"-ERR command not understood, sir\r\n");
diff -ur dbmail/pop3.h dbmail.working/pop3.h
--- dbmail/pop3.h	Wed Mar 13 10:32:28 2002
+++ dbmail.working/pop3.h	Tue Nov 12 10:56:00 2002
@@ -60,7 +60,8 @@
 #define POP3_APOP 11
 #define POP3_AUTH 12
 #define POP3_TOP 13
-#define POP3_END 14
+#define POP3_CAPA 14
+#define POP3_END 15
 
 /* all virtual_ definitions are session specific
  * when a RSET occurs all will be set to the real values */

Reply via email to