X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/487ad115de1c5a97ab4e61bbf3f3bbbdbd97b258..73cbff01edbcf4ba878daf72116de132919d3017:/uip/sendsbr.c?ds=inline diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 10b5f9bd..1088d316 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -535,13 +534,18 @@ make_mime_composition_file_entry(char *file_name, int attachformat, (void) fprintf (composition_file, "#%s <>", content_type); } else { /* Suppress Content-Id, insert simple Content-Disposition - and Content-Description with filename. */ + and Content-Description with 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]{attachment}", + "#%s; name=\"%s\" <> [%s]{%s}", content_type, (p == (char *)0) ? file_name : p + 1, - (p == (char *)0) ? file_name : p + 1); + (p == (char *)0) ? file_name : p + 1, + strcmp ("text/calendar", content_type) + ? "attachment" : "inline"); } break; @@ -554,13 +558,19 @@ make_mime_composition_file_entry(char *file_name, int attachformat, (void) fprintf (composition_file, "#%s <>", content_type); } else { /* Suppress Content-Id, insert Content-Disposition with - modification date and Content-Description wtih filename. */ + 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]{attachment; modification-date=\"%s\"}", + "#%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)); } @@ -1136,6 +1146,4 @@ static void armed_done (int status) { longjmp (env, status ? status : NOTOK); - - exit (status); }