]> code.citadel.org Git - citadel.git/commitdiff
* Dammit, I lost my changes
authorArt Cancro <ajc@citadel.org>
Sat, 7 Oct 2000 22:31:31 +0000 (22:31 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 7 Oct 2000 22:31:31 +0000 (22:31 +0000)
citadel/Makefile.in
citadel/imap_fetch.c [new file with mode: 0644]
citadel/imap_fetch.h [new file with mode: 0644]
citadel/imap_tools.c
citadel/imap_tools.h
citadel/serv_imap.c

index a982940605eab904aec870a88cce9117da89d8b0..a2d373bd5a3c7044d66c2b78a0d82d98cb2a8a11 100644 (file)
@@ -88,7 +88,8 @@ SOURCES=aidepost.c citadel.c citmail.c citserver.c client_chat.c commands.c \
        auth.c chkpwd.c html.c vcard.c serv_upgrade.c serv_vandelay.c \
        serv_smtp.c serv_pop3.c internet_addressing.c parsedate.c genstamp.c \
        domain.c clientsocket.c serv_inetcfg.c serv_rwho.c serv_bio.c \
-       serv_moderate.c client_passwords.c serv_imap.c imap_tools.c \
+       serv_moderate.c client_passwords.c \
+       serv_imap.c imap_tools.c imap_fetch.c \
        serv_network.c serv_pas2.c md5.c
 
 DEP_FILES=$(SOURCES:.c=.d)
@@ -232,8 +233,9 @@ modules/serv_smtp.mo: serv_smtp.mo
 modules/domain.mo: domain.mo
        ln -f domain.mo modules
 
-modules/serv_imap.so: serv_imap.mo imap_tools.mo
-       $(LINK_SHARED) -o modules/serv_imap.so imap_tools.mo serv_imap.mo
+modules/serv_imap.so: serv_imap.mo imap_tools.mo imap_fetch.mo
+       $(LINK_SHARED) -o modules/serv_imap.so imap_tools.mo serv_imap.mo \
+               imap_fetch.mo
 
 modules/serv_imap.mo: serv_imap.mo
        ln -f serv_imap.mo modules
@@ -241,6 +243,9 @@ modules/serv_imap.mo: serv_imap.mo
 modules/imap_tools.mo: imap_tools.mo
        ln -f imap_tools.mo modules
 
+modules/imap_fetch.mo: imap_fetch.mo
+       ln -f imap_fetch.mo modules
+
 aidepost: aidepost.o config.o $(LIBOBJS)
        $(CC) aidepost.o config.o $(LIBOBJS) $(LDFLAGS) -o aidepost
 
diff --git a/citadel/imap_fetch.c b/citadel/imap_fetch.c
new file mode 100644 (file)
index 0000000..ccdaaf1
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * $Id$
+ *
+ * Implements the FETCH command in IMAP.
+ * This command is way too convoluted.  Marc Crispin is a fscking idiot.
+ *
+ */
+
+
+#include "sysdep.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <pwd.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <ctype.h>
+#include <string.h>
+#include <limits.h>
+#include "citadel.h"
+#include "server.h"
+#include <time.h>
+#include "sysdep_decls.h"
+#include "citserver.h"
+#include "support.h"
+#include "config.h"
+#include "dynloader.h"
+#include "room_ops.h"
+#include "user_ops.h"
+#include "policy.h"
+#include "database.h"
+#include "msgbase.h"
+#include "tools.h"
+#include "internet_addressing.h"
+#include "serv_imap.h"
+#include "imap_tools.h"
+#include "imap_fetch.h"
+
+
+
+void imap_do_fetch(int lo, int hi, char *items) {
+}
+
+
+
+
+/*
+ * This function is called by the main command loop.
+ */
+void imap_fetch(int num_parms, char *parms[]) {
+       int lo = 0;
+       int hi = 0;
+       char lostr[1024], histr[1024], items[1024];
+       int i;
+
+       if (num_parms < 4) {
+               cprintf("%s BAD invalid parameters\r\n", parms[0]);
+               return;
+       }
+
+       extract_token(lostr, parms[2], 0, ':');
+       lo = atoi(lostr);
+       extract_token(histr, parms[2], 1, ':');
+       hi = atoi(histr);
+
+       if ( (lo < 1) || (hi < 1) || (lo > hi) || (hi > IMAP->num_msgs) ) {
+               cprintf("%s BAD invalid sequence numbers %d:%d\r\n",
+                       parms[0], lo, hi);
+               return;
+       }
+
+       strcpy(items, "");
+       for (i=3; i<num_parms; ++i) {
+               strcat(items, parms[i]);
+               if (i < (num_parms-1)) strcat(items, " ");
+       }
+
+       imap_do_fetch(lo, hi, items);
+       cprintf("%s OK FETCH completed\r\n", parms[0]);
+}
+
+
+
diff --git a/citadel/imap_fetch.h b/citadel/imap_fetch.h
new file mode 100644 (file)
index 0000000..8293919
--- /dev/null
@@ -0,0 +1,6 @@
+/*
+ * $Id$
+ *
+ */
+
+void imap_fetch(int num_parms, char *parms[]);
index a52c8b50e308f20dfd1de14e52141304b123cfdd..8d59d4e97b702c7c5e588faa37ea262209a40888 100644 (file)
@@ -67,19 +67,3 @@ void imap_mailboxname(char *buf, int bufsize, struct quickroom *qrbuf) {
 }
 
 
-/*
- * Parse a parenthesized list of items (as with the FETCH command)
- */
-int imap_extract_data_items(char *items) {
-       int num_items = 0;
-       int i;
-
-       /* First, convert all whitespace to ordinary space characters */
-       for (i=0; i<strlen(items); ++i) {
-               if (isspace(items[i])) items[i] = ' ';
-       }
-
-       return num_items;
-}
-
-
index 1804448d1eab9d0ecbf30547a9efd634f4066f23..d363cd8c2ea2523e3a796c4e4dc7b0399b835ba3 100644 (file)
@@ -5,5 +5,3 @@
 
 int imap_parameterize(char **args, char *buf);
 void imap_mailboxname(char *buf, int bufsize, struct quickroom *qrbuf);
-int imap_extract_data_items(char *);
-
index 324b6c213ecbc84f47e5908268f4eae104993935..b54e3b24f01c0b417a076d617432db11c109dc40 100644 (file)
@@ -40,6 +40,7 @@
 #include "internet_addressing.h"
 #include "serv_imap.h"
 #include "imap_tools.h"
+#include "imap_fetch.h"
 
 
 long SYM_IMAP;
@@ -297,61 +298,13 @@ void imap_list(int num_parms, char *parms[]) {
 }
 
 
-/*
- * Do the actual work for imap_fetch().  By the time this function is called,
- * the "lo" and "hi" sequence numbers are already validated, and the data item
- * names are, um... something.
- */
-void imap_do_fetch(int lo, int hi, char *items) {
-       cprintf("* lo=%d hi=%d items=<%s>\r\n", lo, hi, items);
-}
-
-/*
- * Mark Crispin is a fscking idiot.
- */
-void imap_fetch(int num_parms, char *parms[]) {
-       int lo = 0;
-       int hi = 0;
-       char lostr[1024], histr[1024], items[1024];
-       int i;
-
-       if (num_parms < 4) {
-               cprintf("%s BAD invalid parameters\r\n", parms[0]);
-               return;
-       }
-
-       extract_token(lostr, parms[2], 0, ':');
-       lo = atoi(lostr);
-       extract_token(histr, parms[2], 1, ':');
-       hi = atoi(histr);
-
-       if ( (lo < 1) || (hi < 1) || (lo > hi) || (hi > IMAP->num_msgs) ) {
-               cprintf("%s BAD invalid sequence numbers %d:%d\r\n",
-                       parms[0], lo, hi);
-               return;
-       }
-
-       strcpy(items, "");
-       for (i=3; i<num_parms; ++i) {
-               strcat(items, parms[i]);
-               if (i < (num_parms-1)) strcat(items, " ");
-       }
-
-       imap_extract_data_items(items);
-
-       imap_do_fetch(lo, hi, items);
-       cprintf("%s OK FETCH completed\r\n", parms[0]);
-}
-
-
-
 
 /* 
  * Main command loop for IMAP sessions.
  */
 void imap_command_loop(void) {
        char cmdbuf[256];
-       char *parms[16];
+       char *parms[256];
        int num_parms;
        int i;