[Bug #35303].
- post(8) can now explicitly control the SMTP envelope address either via
the Sender: header or the new Envelope-From: header.
+- The -attach option is now the default (using Nmh-Attachment) and
+ -attachformat 1 is now the default.
#define LINK "@" /* Name of link to file to which you are */
/* replying. */
+#define NMH_ATTACH_HEADER "Nmh-Attachment" /* Default header for -attach */
+
/*
* miscellaneous macros
*/
.RB [ \-help ]
.RB [ \-attach
.IR header-field-name ]
+.RB [ \-noattach ]
.RB [ \-attachformat
.IR 0 " | " 1 " | " 2 ]
.ad
.BR post .
.PP
-If a
-.I header-field-name
-is supplied using the
-.B -attach
-option, the draft is scanned for a header whose field name matches the
-supplied
-.IR header-field-name .
+By default the draft is scanned for a header named
+.IR Nmh-Attachment .
The draft is converted to a MIME message if one or more matches are found.
-This conversion occurs before all other processing.
+This conversion occurs before all other processing. The header name
+can be changed with the
+.B \-attach
+option. This behavior can be disabled completely with the
+.B \-noattach
+option.
.PP
The first part of the MIME message is the draft body if that body contains
any non-blank characters.
The
.B -attachformat
option specifies the MIME header field formats: a value of
-.B 0,
-the default,
+.B 0
includes the
.I x-unix-mode
attribute as noted above. A value of
-.B 1
+.BR 1 ,
+the default,
suppresses that, puts the file name in the
\*(lqContent-Description\*(rq header, and
adds a \*(lqContent-Disposition\*(rq header. A value of
.RB ` \-noverbose '
.RB ` \-nowatch '
.RB ` "\-width\ 72" '
-.RB ` "\-attachformat\ 0" '
+.RB ` "\-attach\ Nmh-Attachment" '
+.RB ` "\-attachformat\ 1" '
.fi
.SH CONTEXT
.RB [ \-help ]
.RB [ \-attach
.IR header-field-name ]
+.RB [ \-noattach ]
.ad
.SH DESCRIPTION
.B Whatnow
.SH DEFAULTS
.nf
.RB ` \-prompt "' defaults to \*(lqWhat\ Now?\ \*(rq"
+.RB ` \-attach "' defaults to \*(lqNmh-Attachment\*(rq"
.fi
.SH CONTEXT
{ "user username", SASLminc(-4) },
#define ATTACHSW 42
{ "attach", 6 },
-#define ATTACHFORMATSW 43
+#define NOATTACHSW 43
+ { "noattach", 0 },
+#define ATTACHFORMATSW 44
{ "attachformat", 7 },
-#define PORTSW 44
+#define PORTSW 45
{ "port server-port-name/number" , 4 },
-#define TLSSW 45
+#define TLSSW 46
{ "tls", TLSminc(-3) },
-#define NTLSSW 46
+#define NTLSSW 47
{ "notls", TLSminc(-5) },
{ NULL, 0 }
};
char *msgs[MAXARGS], *vec[MAXARGS];
struct msgs *mp;
struct stat st;
- char *attach = (char *)0; /* header field name for attachments */
- int attachformat = 0; /* mhbuild format specifier for attachments */
+ char *attach = NMH_ATTACH_HEADER; /* header field name for attachments */
+ int attachformat = 1; /* mhbuild format specifier for attachments */
#ifdef LOCALE
setlocale(LC_ALL, "");
if (!(attach = *argp++) || *attach == '-')
adios (NULL, "missing argument to %s", argp[-2]);
continue;
+ case NOATTACHSW:
+ attach = NULL;
+ continue;
case ATTACHFORMATSW:
if (! *argp || **argp == '-')
{ "help", 0 },
#define ATTACHSW 8
{ "attach header-field-name", 0 },
+#define NOATTACHSW 9
+ { "noattach", 0 },
{ NULL, 0 }
};
char buf[BUFSIZ], prompt[BUFSIZ];
char **argp, **arguments;
struct stat st;
- char *attach = (char *)0; /* attachment header field name */
+ char *attach = NMH_ATTACH_HEADER;/* attachment header field name */
char cwd[MAXPATHLEN + 1]; /* current working directory */
char file[MAXPATHLEN + 1]; /* file name buffer */
char shell[MAXPATHLEN + 1]; /* shell response buffer */
continue;
case ATTACHSW:
- if (attach != (char *)0)
- adios(NULL, "only one attachment header field name at a time!");
if (!(attach = *argp++) || *attach == '-')
adios (NULL, "missing argument to %s", argp[-2]);
continue;
+
+ case NOATTACHSW:
+ attach = NULL;
+ continue;
}
}
if (drft)
{ "user", SASLminc(-4) },
#define SNDATTACHSW 41
{ "attach file", 6 },
-#define SNDATTACHFORMAT 42
+#define SNDNOATTACHSW 42
+ { "noattach", 0 },
+#define SNDATTACHFORMAT 43
{ "attachformat", 7 },
-#define PORTSW 43
+#define PORTSW 44
{ "port server-port-name/number", 4 },
-#define TLSSW 44
+#define TLSSW 45
{ "tls", TLSminc(-3) },
-#define NTLSSW 45
+#define NTLSSW 46
{ "notls", TLSminc(-5) },
{ NULL, 0 }
};
char *cp, buf[BUFSIZ], **argp;
char **arguments, *vec[MAXARGS];
struct stat st;
- char *attach = (char *)0; /* attachment header field name */
- int attachformat = 0; /* mhbuild format specifier for
+ char *attach = NMH_ATTACH_HEADER;/* attachment header field name */
+ int attachformat = 1; /* mhbuild format specifier for
attachments */
#ifndef lint
return;
}
continue;
+ case SNDNOATTACHSW:
+ attach = NULL;
+ continue;
case SNDATTACHFORMAT:
if (! *argp || **argp == '-')