* uip/sendsbr.c: with attachformat values of 1 or 2, only
authorDavid Levine <levinedl@acm.org>
Thu, 30 Mar 2006 22:19:50 +0000 (22:19 +0000)
committerDavid Levine <levinedl@acm.org>
Thu, 30 Mar 2006 22:19:50 +0000 (22:19 +0000)
generate Content-Disposition headers for MIME attachments, not
for the message contents themselves.  Microsoft Outlook Build
10.0.6626, at least, doesn't show the message contents if they
have Content-Disposition.

ChangeLog
uip/sendsbr.c

index 0eaa651..b2ebfe6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-03-30  David Levine <levinedl@acm.org>
+
+       * uip/sendsbr.c: with attachformat values of 1 or 2, only
+       generate Content-Disposition headers for MIME attachments, not
+       for the message contents themselves.  Microsoft Outlook Build
+       10.0.6626, at least, doesn't show the message contents if they
+       have Content-Disposition.
+
 2006-03-09  Josh Bressers <josh@bress.net>
 
        * sbr/fmt_rfc2047.c (decode_rfc2047): Don't close the iconv descriptor
index 8930857..f8384f7 100644 (file)
@@ -489,17 +489,35 @@ make_mime_composition_file_entry(char *file_name, int attachformat)
 
         break;
     case 1:
-        /* Suppress Content-Id, insert simple Content-Disposition. */
-        (void) fprintf (composition_file, "#%s <>{attachment}", content_type);
+        if (stringdex (m_maildir(invo_name), file_name) == 0) {
+            /* Content had been placed by send into a temp file.
+               Don't generate Content-Disposition header, because
+               it confuses Microsoft Outlook, Build 10.0.6626, at
+               least. */
+            (void) fprintf (composition_file, "#%s <>", content_type);
+        } else {
+            /* Suppress Content-Id, insert simple Content-Disposition. */
+            (void) fprintf (composition_file,
+                            "#%s <>{attachment}",
+                            content_type);
+        }
 
         break;
     case 2:
-        /* Suppress Content-Id, insert Content-Disposition with
-           modification date. */
-        (void) fprintf (composition_file,
-                        "#%s <>{attachment; modification-date=\"%s\"}",
-                        content_type,
-                        dtime (&st.st_mtime, 0));
+        if (stringdex (m_maildir(invo_name), file_name) == 0) {
+            /* Content had been placed by send into a temp file.
+               Don't generate Content-Disposition header, because
+               it confuses Microsoft Outlook, Build 10.0.6626, at
+               least. */
+            (void) fprintf (composition_file, "#%s <>", content_type);
+        } else {
+            /* Suppress Content-Id, insert Content-Disposition with
+               modification date. */
+            (void) fprintf (composition_file,
+                            "#%s <>{attachment; modification-date=\"%s\"}",
+                            content_type,
+                            dtime (&st.st_mtime, 0));
+        }
 
         break;
     default: