]> code.citadel.org Git - citadel.git/commitdiff
* IMAP is now legal but useless, supporting NOOP, LOGIN, and LOGOUT.
authorArt Cancro <ajc@citadel.org>
Wed, 21 Jun 2000 03:46:20 +0000 (03:46 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 21 Jun 2000 03:46:20 +0000 (03:46 +0000)
citadel/ChangeLog
citadel/serv_imap.c

index b1607467c5d0c58cbe555ba6f6bfe54ccbbb3c29..ddf19a164a94944d058d64817943dab13acc45c3 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 572.6  2000/06/21 03:46:20  ajc
+ * IMAP is now legal but useless, supporting NOOP, LOGIN, and LOGOUT.
+
  Revision 572.5  2000/06/15 20:15:52  ajc
  * Inserted a skeleton IMAP module into the build.  IT DOES NOT WORK AT ALL.
 
@@ -1909,3 +1912,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
+
index ea52672b14a202a0e5250acb5ab337648e8ea92b..e0efcc14a9ebc338b56c5c8221cc0145ec5394a8 100644 (file)
@@ -85,10 +85,27 @@ void imap_login(char *tag, char *cmd, char *parms) {
        extract_token(username, parms, 0, ' ');
        extract_token(password, parms, 1, ' ');
 
-       cprintf("%s BAD hi <%s> <%s>\r\n", username, password);
+       if (CtdlLoginExistingUser(username) == login_ok) {
+               if (CtdlTryPassword(password) == pass_ok) {
+                       cprintf("%s OK login successful\r\n", tag);
+                       return;
+               }
+        }
+
+       cprintf("%s BAD Login incorrect\r\n", tag);
 }
 
 
+/*
+ * implements the CAPABILITY command
+ */
+void imap_capability(char *tag, char *cmd, char *parms) {
+       cprintf("* CAPABILITY IMAP4 IMAP4REV1 AUTH=LOGIN\r\n");
+       cprintf("%s OK CAPABILITY completed\r\n", tag);
+}
+
+
+
 
 /* 
  * Main command loop for IMAP sessions.
@@ -128,6 +145,7 @@ void imap_command_loop(void) {
        }
 
        else if (!strcasecmp(cmd, "LOGOUT")) {
+               cprintf("* BYE %s logging out\r\n", config.c_fqdn);
                cprintf("%s OK thank you for using Citadel IMAP\r\n", tag);
                CC->kill_me = 1;
                return;
@@ -137,6 +155,10 @@ void imap_command_loop(void) {
                imap_login(tag, cmd, cmdbuf);
        }
 
+       else if (!strcasecmp(cmd, "CAPABILITY")) {
+               imap_capability(tag, cmd, cmdbuf);
+       }
+
        else if (!CC->logged_in) {
                cprintf("%s BAD Not logged in.\r\n", tag);
        }