X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/4e3c586d24d33c0d0f6b1f16a84cf9b1a08076d7..73cbff01edbcf4ba878daf72116de132919d3017:/uip/sendsbr.c diff --git a/uip/sendsbr.c b/uip/sendsbr.c index e3a8195f..1088d316 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -438,7 +437,8 @@ make_mime_composition_file_entry(char *file_name, int attachformat, if ((p = strrchr(file_name, '.')) != (char *)0) { for (np = m_defs; np; np = np->n_next) { - if (strncasecmp(np->n_name, "mhshow-suffix-", 14) == 0 && mh_strcasecmp(p, np->n_field) == 0) { + if (strncasecmp(np->n_name, "mhshow-suffix-", 14) == 0 && + strcasecmp(p, np->n_field ? np->n_field : "") == 0) { content_type = np->n_name + 14; break; } @@ -534,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; @@ -553,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)); } @@ -616,15 +627,15 @@ splitmsg (char **vec, int vecp, char *program, char *drft, /* * This header field is discarded. */ - if (!mh_strcasecmp (name, "Message-ID")) { + if (!strcasecmp (name, "Message-ID")) { while (state == FLDPLUS) { bufsz = sizeof buffer; state = m_getfld (&gstate, name, buffer, &bufsz, in); } } else if (uprf (name, XXX_FIELD_PRF) - || !mh_strcasecmp (name, VRSN_FIELD) - || !mh_strcasecmp (name, "Subject") - || !mh_strcasecmp (name, "Encrypted")) { + || !strcasecmp (name, VRSN_FIELD) + || !strcasecmp (name, "Subject") + || !strcasecmp (name, "Encrypted")) { /* * These header fields are copied to the enclosed * header of the first message in the collection @@ -633,7 +644,7 @@ splitmsg (char **vec, int vecp, char *program, char *drft, * version of it, can be copied to the header * of each messsage/partial in the collection. */ - if (!mh_strcasecmp (name, "Subject")) { + if (!strcasecmp (name, "Subject")) { size_t sublen; strncpy (subject, buffer, BUFSIZ); @@ -1064,7 +1075,7 @@ annoaux (int fd) admonish (maildir, "unable to change directory to"); return; } - if (!(mp = folder_read (folder))) { + if (!(mp = folder_read (folder, 0))) { if (debugsw) admonish (NULL, "unable to read folder %s", folder); return; @@ -1135,6 +1146,4 @@ static void armed_done (int status) { longjmp (env, status ? status : NOTOK); - - exit (status); }