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)
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
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
--- /dev/null
+/*
+ * $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]);
+}
+
+
+
--- /dev/null
+/*
+ * $Id$
+ *
+ */
+
+void imap_fetch(int num_parms, char *parms[]);
}
-/*
- * 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;
-}
-
-
int imap_parameterize(char **args, char *buf);
void imap_mailboxname(char *buf, int bufsize, struct quickroom *qrbuf);
-int imap_extract_data_items(char *);
-
#include "internet_addressing.h"
#include "serv_imap.h"
#include "imap_tools.h"
+#include "imap_fetch.h"
long SYM_IMAP;
}
-/*
- * 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;