* uip/sendsbr.c: with attachformat values of 1 or 2, add
authorDavid Levine <levinedl@acm.org>
Tue, 24 Oct 2006 14:31:40 +0000 (14:31 +0000)
committerDavid Levine <levinedl@acm.org>
Tue, 24 Oct 2006 14:31:40 +0000 (14:31 +0000)
name= portion to Content-Type header.  This makes them
consistent with attachformat value 0.  And it allows mhstore
to use that (file)name when extracting attachments.

ChangeLog
uip/sendsbr.c

index a0839ee..9e33cb8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-24  David Levine <levinedl@acm.org>
+
+       * uip/sendsbr.c: with attachformat values of 1 or 2, add
+       name= portion to Content-Type header.  This makes them
+       consistent with attachformat value 0.  And it allows mhstore
+       to use that (file)name when extracting attachments.
+
 2006-08-26  Josh Bressers <josh@bress.net>
 
        * configure.in: If we're not using dotlocking, there is no need to set
index f8384f7..2d9a7d4 100644 (file)
@@ -498,8 +498,9 @@ make_mime_composition_file_entry(char *file_name, int attachformat)
         } else {
             /* Suppress Content-Id, insert simple Content-Disposition. */
             (void) fprintf (composition_file,
-                            "#%s <>{attachment}",
-                            content_type);
+                            "#%s; name=\"%s\" <>{attachment}",
+                            content_type,
+                            ((p = strrchr(file_name, '/')) == (char *)0) ? file_name : p + 1);
         }
 
         break;
@@ -514,8 +515,9 @@ make_mime_composition_file_entry(char *file_name, int attachformat)
             /* Suppress Content-Id, insert Content-Disposition with
                modification date. */
             (void) fprintf (composition_file,
-                            "#%s <>{attachment; modification-date=\"%s\"}",
+                            "#%s; name=\"%s\" <>{attachment; modification-date=\"%s\"}",
                             content_type,
+                            ((p = strrchr(file_name, '/')) == (char *)0) ? file_name : p + 1,
                             dtime (&st.st_mtime, 0));
         }