fi
fi
+####
+#### mhbuild-disposition-<type>[/<subtype>] entries are used by the
+#### WhatNow attach for deciding whether the Content-Disposition
+#### should be 'attachment' or 'inline'. Only those values are
+#### supported.
+####
+cat <<EOF >> ${TMP}
+mhbuild-disposition-text/calendar: inline
+mhbuild-disposition-message/rfc822: inline
+EOF
+
PGM="`$SEARCHPROG $SEARCHPATH mpeg_play`"
if [ ! -z "$PGM" ]; then
echo "mhshow-show-video/mpeg: %p$PGM %f" >> $TMP
directives (see below). See
.IR send (1)
for more details.
+.PP
+By default, the Content-Disposition will be \*(lqattachment\*(rq.
+.B mhbuild
+looks for user profile and mhn.defaults entries of the form
+.PP
+.RS 5
+mhbuild-disposition-<type>/<subtype>
+.RE
+or
+.RS 5
+mhbuild-disposition-<type>
+.RE
+.PP
+to supply the disposition value. The only supported values are
+.I attachment
+and
+.IR inline.
.SS "Translating the Composition File"
.B mhbuild
is essentially a filter to aid in the composition of MIME
char *type, *simplename = r1bindex(filename, '/');
struct str2init *s2i;
PM pm;
+ char buffer[BUFSIZ], *cp;
+ int no_subtype = 0;
if (! (type = mime_type(filename))) {
adios(NULL, "Unable to determine MIME type of \"%s\"", filename);
ct->c_cefile.ce_file = getcpy(filename);
/*
- * If it's a text/calendar, we need to make sure it's an inline,
- * otherwise it won't work with some calendar programs. Otherwise
- * assume attachment
+ * Look for mhbuild-disposition-<type>/<subtype> entry
+ * that specifies Content-Disposition type. Only
+ * 'attachment' and 'inline' are allowed. Default to
+ * 'attachment'.
*/
- if (strcasecmp(ct->c_ctinfo.ci_type, "text") == 0 &&
- strcasecmp(ct->c_ctinfo.ci_subtype, "calendar") == 0) {
- ct->c_dispo_type = getcpy("inline");
+ snprintf (buffer, sizeof(buffer), "%s-disposition-%s/%s",
+ invo_name, ct->c_ctinfo.ci_type, ct->c_ctinfo.ci_subtype);
+ cp = context_find (buffer);
+ if (cp == NULL || *cp == '\0') {
+ no_subtype = 1;
+ snprintf (buffer, sizeof(buffer), "%s-disposition-%s", invo_name,
+ ct->c_ctinfo.ci_type);
+ cp = context_find (buffer);
+ }
+ if (cp != NULL && *cp != '\0') {
+ if (strcasecmp (cp, "attachment") &&
+ strcasecmp (cp, "inline")) {
+ admonish (NULL, "configuration problem: %s-disposition-%s%s%s "
+ "specifies '%s' but only 'attachment' and 'inline' are "
+ "allowed", invo_name,
+ ct->c_ctinfo.ci_type,
+ no_subtype ? "" : "/",
+ no_subtype ? "" : ct->c_ctinfo.ci_subtype,
+ cp);
+ }
+ }
+
+ if (cp) {
+ ct->c_dispo_type = getcpy(cp);
} else {
ct->c_dispo_type = getcpy("attachment");
}