]> code.citadel.org Git - citadel.git/commitdiff
* Still more work on IMAP. Damn this is tedious.
authorArt Cancro <ajc@citadel.org>
Sat, 30 Dec 2000 06:17:17 +0000 (06:17 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 30 Dec 2000 06:17:17 +0000 (06:17 +0000)
citadel/ChangeLog
citadel/imap_fetch.c

index d3b3d1f72ef38ee7a97242e61c7df4abe56178a4..9b6b32b94cecfb43c9cdf663aa414679eeefaaa7 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 573.61  2000/12/30 06:17:17  ajc
+ * Still more work on IMAP.  Damn this is tedious.
+
  Revision 573.60  2000/12/30 04:55:05  ajc
  * more buffer size stuff
 
@@ -2256,4 +2259,3 @@ 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 1e1890ef8d42d3b050fbdf0e0b490c6f15b3762b..099b643cd5dae8029b045e0d7cecdd832ba61263 100644 (file)
@@ -457,6 +457,65 @@ void imap_fetch_body(long msgnum, char *item, int is_peek,
 }
 
 
+
+/*
+ * Output the info for a MIME part in the format required by BODYSTRUCTURE.
+ *
+ * FIXME .... this needs oodles of work to get completed.
+ */
+void imap_fetch_bodystructure_part(
+               char *name, char *filename, char *partnum, char *disp,
+               void *content, char *cbtype, size_t length, char *encoding,
+               void *cbuserdata
+               ) {
+
+       char buf[SIZ];
+
+       cprintf("(");
+
+       if (cbtype == NULL) {
+               cprintf("\"TEXT\" \"PLAIN\" ");
+       }
+       else {
+               extract_token(buf, cbtype, 0, '/');
+               imap_strout(buf);
+               cprintf(" ");
+               extract_token(buf, cbtype, 1, '/');
+               imap_strout(buf);
+               cprintf(" ");
+       }
+
+       cprintf("(\"CHARSET\" \"US-ASCII\"");
+
+       if (name != NULL) {
+               cprintf(" \"NAME\" ");
+               imap_strout(name);
+       }
+
+       if (filename != NULL) {
+               cprintf(" \"FILENAME\" ");
+               imap_strout(name);
+       }
+
+       cprintf(") ");
+
+       cprintf("NIL NIL ");
+
+       if (encoding != NULL) {
+               imap_strout(encoding);
+       }
+       else {
+               imap_strout("7BIT");
+       }
+       cprintf(" ");
+
+       cprintf("%ld ", length);        /* bytes */
+       cprintf("NIL) ");               /* lines */
+
+}
+
+
+
 /*
  * Spew the BODYSTRUCTURE data for a message.  (Do you need a silencer if
  * you're going to shoot a MIME?  Do you need a reason to shoot Mark Crispin?
@@ -499,9 +558,13 @@ void imap_fetch_bodystructure (long msgnum, char *item,
        }
 
        /* For messages already stored in RFC822 format, we have to parse. */
-       /* FIXME do this! */
-
-
+       cprintf("BODYSTRUCTURE (");
+       mime_parser(msg->cm_fields['M'],
+                       NULL,
+                       *imap_fetch_bodystructure_part,
+                       NULL,
+                       0);
+       cprintf(") ");
 }