- /* 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 and Content-Description wtih filename.
+ The Content-Disposition type needs to be "inline" for
+ MS Outlook and BlackBerry calendar programs to properly
+ handle a text/calendar attachment. */
+ p = strrchr(file_name, '/');
+ (void) fprintf (composition_file,
+ "#%s; name=\"%s\" <>[%s]{%s; "
+ "modification-date=\"%s\"}",
+ content_type,
+ (p == (char *)0) ? file_name : p + 1,
+ (p == (char *)0) ? file_name : p + 1,
+ strcmp ("text/calendar", content_type)
+ ? "attachment" : "inline",
+ dtime (&st.st_mtime, 0));
+ }