directive that send(1) will use.
- mhbuild(1) now supports the -auto/-noauto flags (to be used by send(1)
when invoking mhbuild automatically).
+ - mhbuild(1) now is automatically run by send, to insure that all outgoing
+ messages have proper MIME formatting.
+ - A new header, "Attach", is supported by mhbuild; it is used to replace
+ previous functionality (which by default used a header named
+ Nmh-Attachment).
-----------------
OBSOLETE FEATURES
ap(8) commands has been removed.
- "make install" no longer strips executables. Use "make install-strip"
instead.
+- The environment variable MM_CHARSET to indicate the native character
+ set is no longer supported. The native character set will be solely
+ determined by the locale settings.
-------------------
DEPRECATED FEATURES
(profile, default: vi)
.RE
.PP
- .BR automimeproc :
- .RS 5
- If defined and set to 1, then the
- .B whatnow
- program will automatically
- invoke the buildmimeproc (discussed below) to process each message as a MIME
- composition draft before it is sent.
- (profile, no default)
- .RE
- .PP
.BR Msg\-Protect :
600
.RS 5
in addition to the mhn.defaults profile.
.RE
.PP
-.B $MM_CHARSET
-.RS 5
-With this environment variable, you can specify
-the native character set you are using. You must be able to display
-this character set on your terminal.
-.PP
-This variable is checked to see if a RFC 2047 header field should be
-decoded (in
-.BR inc ,
-.BR scan ,
-.BR mhl ).
-This variable is
-checked by
-.B show
-to see if the
-.I showproc
-or
-.I showmimeproc
-should
-be called, since showmimeproc will be called if a text message uses
-a character set that doesn't match
-.BR $MM_CHARSET .
-This variable is
-checked by
-.B mhshow
-for matches against the charset parameter
-of text contents to decide it the text content can be displayed
-without modifications to your terminal. This variable is checked by
-.B mhbuild
-to decide what character set to specify in the charset
-parameter of text contents containing 8\-bit characters.
-.PP
-When decoding text in such an alternate character set,
-.B nmh
-must be able to determine which characters are alphabetic, which
-are control characters, etc. For many operating systems, this
-will require enabling the support for locales (such as setting
-the environment variable
-.B $LC_CTYPE
-to iso_8859_1).
-.RE
-.PP
.B $MAILDROP
.RS 5
This variable tells
- .TH MHBUILD %manext1% "March 21, 2013" "%nmhversion%"
+ .TH MHBUILD %manext1% "January 23, 2014" "%nmhversion%"
.\"
.\" %nmhwarning%
.\"
.RB [ \-headerencoding
.IR encoding\-algorithm
.RB " | " \-autoheaderencoding ]
+ .RB [ \-dist ]
.RB [ \-version ]
.RB [ \-help ]
.ad
is present, then the listing will show any \*(lqextra\*(rq information
that is present in the message, such as comments in the
\*(lqContent-Type\*(rq header.
+ .SS "Simplified Attachment Interface"
+ For users who wish to simply attach files to text content,
+ .B mhbuild
+ will scan the composition file for \*(lqAttach\*(rq headers. An
+ \*(lqAttach\*(rq header contains a filename that will be appended to the
+ message using normal MIME encapsulation rules. One filename is allowed
+ per \*(lqAttach\*(rq header, but multiple \*(lqAttach\*(rq headers are
+ allowed ber composition file.
+ .PP
+ These files will be appended after any other MIME content, including any
+ content specified by
+ .B mhbuild
+ directives (see below). See
+ .IR send (1)
+ for more details.
.SS "Translating the Composition File"
.B mhbuild
is essentially a filter to aid in the composition of MIME
high bit set) and the character set is not specified as above, then
.B mhbuild
will assume the character set is of the type given by the
-environment variable MM_CHARSET. If this environment variable is not
+standard
+.IR locale (1)
+environment variables. If these environment variables are not
set, then the character set will be labeled as \*(lqx-unknown\*(rq.
.PP
If a text content contains only 7\-bit characters and the character set
switch will cause
.B mhbuild
to exit without error if the input file already has valid MIME headers.
- .PP
- It is also possible to have the
- .B whatnow
- program invoke
- .B mhbuild
- automatically when a message is sent. To do this, you must add the line
- .PP
- .RS 5
- automimeproc: 1
- .RE
- .PP
- to your
- .I \&.mh\(ruprofile
- file.
+ The use of
+ .B \-auto
+ also enables the
+ .B \-nodirectives
+ switch.
.PP
Finally, you should consider adding this line to your profile:
.PP
.RE
.PP
will work as you expect.
+ .PP
+ The
+ .B \-dist
+ switch is intended to be used by
+ .BR dist .
+ It will cause mhbuild to not generate any MIME headers in the composition
+ file (such as \*(lqMIME-Version\*(rq or \*(lqContent-Type\*(rq), but it
+ will still encode message headers according to RFC 2047.
.SS "User Environment"
Because the environment in which
.B mhbuild
X("version", 0, VERSIONSW) \
X("help", 0, HELPSW) \
X("debug", -5, DEBUGSW) \
+ X("dist", -4, DISTSW) \
#define X(sw, minchars, id) id,
DEFINE_SWITCH_ENUM(MHBUILD);
int
main (int argc, char **argv)
{
- int sizesw = 1, headsw = 1, directives = 1, autobuild = 0;
+ int sizesw = 1, headsw = 1, directives = 1, autobuild = 0, dist = 0;
int *icachesw;
char *cp, buf[BUFSIZ];
char buffer[BUFSIZ], *compfile = NULL;
done=unlink_done;
-#ifdef LOCALE
setlocale(LC_ALL, "");
-#endif
invo_name = r1bindex (argv[0], '/');
/* read user profile/context */
case DEBUGSW:
debugsw = 1;
continue;
+ case DISTSW:
+ dist = 1;
+ continue;
}
}
if (compfile)
unlink_infile = 1;
/* build the content structures for MIME message */
- ct = build_mime (infile, autobuild, directives, header_encoding);
+ ct = build_mime (infile, autobuild, dist, directives, header_encoding);
/*
* If ct == NULL, that means that -auto was set and a MIME version
*/
/* build the content structures for MIME message */
- ct = build_mime (compfile, autobuild, directives, header_encoding);
+ ct = build_mime (compfile, autobuild, dist, directives, header_encoding);
/*
* If ct == NULL, that means -auto was set and we found a MIME version
X("saslmaxssf", SASLminc(-10), SASLMXSSFSW) \
X("saslmech mechanism", SASLminc(-5), SASLMECHSW) \
X("user username", SASLminc(-4), USERSW) \
- X("attach", 6, ATTACHSW) \
- X("noattach", 0, NOATTACHSW) \
+ X("attach", -6, ATTACHSW) \
+ X("noattach", -8, NOATTACHSW) \
X("attachformat", 7, ATTACHFORMATSW) \
X("port server-port-name/number", 4, PORTSW) \
X("tls", TLSminc(-3), TLSSW) \
char *msgs[MAXARGS], **vec;
struct msgs *mp;
struct stat st;
- char *attach = NMH_ATTACH_HEADER; /* header field name for attachments */
- int attachformat = 1; /* mhbuild format specifier for attachments */
-#ifdef LOCALE
setlocale(LC_ALL, "");
-#endif
invo_name = r1bindex (argv[0], '/');
/* read user profile/context */
continue;
case ATTACHSW:
- if (!(attach = *argp++) || *attach == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ advise(NULL, "The -attach switch is deprecated");
continue;
case NOATTACHSW:
- attach = NULL;
+ advise(NULL, "The -noattach switch is deprecated");
continue;
case ATTACHFORMATSW:
- if (! *argp || **argp == '-')
- adios (NULL, "missing argument to %s", argp[-1]);
- else {
- attachformat = atoi (*argp);
- if (attachformat < 0 ||
- attachformat > ATTACHFORMATS - 1) {
- advise (NULL, "unsupported attachformat %d",
- attachformat);
- continue;
- }
- }
- ++argp;
+ advise(NULL, "The -attachformat switch is deprecated");
continue;
}
} else {
closefds (3);
for (msgnum = 0; msgnum < msgp; msgnum++) {
- switch (sendsbr (vec, vecp, program, msgs[msgnum], &st, 1, attach,
- attachformat)) {
+ switch (sendsbr (vec, vecp, program, msgs[msgnum], &st, 1)) {
case DONE:
done (++status);
case NOTOK:
int delay = 0;
char *f1 = NULL, *f2 = NULL, *f3 = NULL;
char *f4 = NULL, *f5 = NULL, *f7 = NULL;
- static char postpath[PATH_MAX];
char *cp, buf[BUFSIZ];
char **argp, **arguments;
-#ifdef LOCALE
setlocale(LC_ALL, "");
-#endif
invo_name = r1bindex (argv[0], '/');
- /* foil search of user profile/context */
- if (context_foil (NULL) == -1)
- done (1);
+ context_read();
arguments = getarguments (invo_name, argc, argv, 0);
argp = arguments;
if (!f1)
adios (NULL, "missing -viamail \"mailpath\" switch");
- /* viamail doesn't read the context and postproc isn't always what
- we want, such as when running make distcheck. If we have the
- absolute path, set postproc to point to post in the same
- directory as this executable.
- This could be generalized to handle relative paths (by
- converting to absolute), to find the full path from PATH given
- just the basename, and to squash out ../ but it's only needed
- here. viamail is typically called from sendfiles, which
- provides the absolute path.
- */
- if (argv[0] && argv[0][0] == '/' &&
- strlen(argv[0]) - 3 < sizeof postpath) {
- strncpy (postpath, argv[0], sizeof postpath - 1);
- postpath[sizeof postpath - 1] = '\0';
- if ((cp = strrchr (postpath, '/'))) {
- struct stat st;
-
- *(cp + 1) = '\0';
- /* strlen ("post") <= sizeof postpath - (cp - postpath) - 2
- but use strncat just in case the code above changes. */
- strncat (postpath, "post", sizeof postpath - (cp - postpath) - 2);
-
- if (stat (postpath, &st) == OK) {
- postproc = postpath;
- }
- }
- }
-
via_mail (f1, f2, f3, f4, f5, delay, f7);
return 0; /* dead code to satisfy the compiler */
}
vec[vecp++] = cp;
}
- switch (sendsbr (vec, vecp, program, tmpfil, &st, 0, (char *)0, 0)) {
+ switch (sendsbr (vec, vecp, program, tmpfil, &st, 0)) {
case DONE:
case NOTOK:
status++;