When outputting the extension data for a
authorArt Cancro <ajc@citadel.org>
Thu, 23 Aug 2007 19:31:42 +0000 (19:31 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 23 Aug 2007 19:31:42 +0000 (19:31 +0000)
MIME part in BODYSTRUCTURE, the parameter 'NAME' now appears as
the first item in the list.  Previously we output 'CHARSET' first.  Either
one is perfectly legal IMAP, but the Asterisk voicemail application
stupidly assumes that 'NAME' will come first, and barfs if it doesn't.  So
we cater to its naivete.

citadel/modules/imap/imap_fetch.c

index 3af4e8cb7447533f631861acd4eb5d39cc14c287..2165688125cea1edadc66a1cb5baa53445d0adbc 100644 (file)
@@ -793,6 +793,10 @@ void imap_fetch_bodystructure_part(
 
        cprintf("(");                                                   /* begin body parameter list */
 
+       /* "NAME" must appear as the first parameter.  This is not required by IMAP,
+        * but the Asterisk voicemail application blindly assumes that NAME will be in
+        * the first position.  If it isn't, it rejects the message.
+        */
        if (name != NULL) if (!IsEmptyStr(name)) {
                cprintf("\"NAME\" ");
                imap_strout(name);