#include <h/mh.h>
#include <h/signals.h>
#include <setjmp.h>
-#include <signal.h>
#include <fcntl.h>
#include <h/mime.h>
#include <h/tws.h>
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;
}
(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;
(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));
}
/*
* 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
* 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);
fprintf (stderr, "unable to exec ");
perror (postproc);
_exit (-1);
- break; /* NOT REACHED */
default:
/*
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;
armed_done (int status)
{
longjmp (env, status ? status : NOTOK);
-
- exit (status);
}