AC_PROG_AWK dnl Check for mawk,gawk,nawk, then awk
AC_PROG_LEX dnl Check for lex/flex
-dnl Look for `realpath'
-pathtmp=/bin:/usr/bin:/usr/local/bin
-AC_PATH_PROG(realpathpath, realpath, no, [$pathtmp])
-
dnl Look for `cut'
pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb
AC_PATH_PROG(cutpath, cut, no, [$pathtmp])
/usr/spool/mail dnl
/dev/null; dnl Just in case we fall through
do
- mailspool = $realpathpath $mailspool;
test -d $mailspool && break
done
nmh_cv_mailspool=$mailspool
if test "$lspath" != "no" -a "$cutpath" != "no"; then
AC_CACHE_CHECK(whether the mail spool is world-writable,
nmh_cv_mailspool_world_writable,
- [if test "`$lspath -dlL $mailspool | $cutpath -c9`" = "-"; then
+ [if test "`$lspath -dl $mailspool/ | $cutpath -c9`" = "-"; then
nmh_cv_mailspool_world_writable=no
else
nmh_cv_mailspool_world_writable=yes
}
if (!*vp) {
advise(NULL, "invalid parameter in message %s's %s: field\n%*.*s(parameter %s)", ct->c_file, TYPE_FIELD, i, i, "", *ap);
- return NOTOK;
+ *ci->ci_values[ap - ci->ci_attrs] = '\0';
+ *ci->ci_attrs[ap - ci->ci_attrs] = '\0';
+ continue;
}
ap++;
if (ct->c_encoding != CE_7BIT && ct->c_encoding != CE_8BIT
&& ct->c_encoding != CE_BINARY) {
admonish(NULL, "\"%s/%s\" type in message %s must be encoded in 7bit, 8bit, or binary", ci->ci_type, ci->ci_subtype, ct->c_file);
- return NOTOK;
+ ct->c_encoding = CE_7BIT;
}
/* match subtype */
static char *subject = NULL; /* the subject field for BCC'ing */
static char fccs[BUFSIZ] = "";
struct mailname *bccs = NULL; /* list of the bcc recipients */
+struct mailname *sender = NULL;
static struct headers *hdrtab; /* table for the message we're doing */
static FILE *out; /* output (temp) file */
for (compnum = 1, state = FLD;;) {
switch (state = m_getfld(state, name, buf, sizeof(buf), in)) {
case FLD:
- compnum++;
- putfmt(name, buf, out);
- continue;
-
case FLDPLUS:
compnum++;
- cp = add(buf, cp);
+ cp = getcpy(buf);
while (state == FLDPLUS) {
state = m_getfld(state, name, buf,
sizeof(buf), in);
if (hdr->set & MFRM) {
struct mailname *mp = NULL;
+ struct mailname *my = NULL;
+ unsigned int fromcnt = 0;
/* needed because the address parser holds global state */
ismymbox(NULL);
while ((cp = getname(str)) != NULL) {
+ fromcnt++;
mp = getm(cp, NULL, 0, AD_NAME, NULL);
if (ismymbox(mp)) {
msgflags |= MFMM;
+ if (my == NULL) {
+ my = mp;
+ } else {
+ mnfree(mp);
+ mp = NULL;
+ }
+ } else {
+ mnfree(mp);
+ mp = NULL;
}
}
+
+ if (fromcnt > 1) {
+ sender = my;
+ } else {
+ mnfree(my);
+ }
+
+ free(cp);
+ cp = NULL;
+
}
if (hdr->flags & HSUB) {
fprintf(out, "%sDate: %s\n", resentstr, dtimenow());
}
- if ((cp = context_find("Default-From")) != NULL) {
+ if (sender != NULL) {
+ snprintf(signature, sizeof(signature), "%s", sender->m_text);
+ } else if ((cp = context_find("Default-From")) != NULL) {
snprintf(signature, sizeof(signature), "%s", cp);
} else {
snprintf(from, sizeof(from), "%s@%s", getusername(), LocalName());
** Add a Sender: header because the From: header could
** be fake or contain multiple addresses.
*/
- if (!(msgflags & MFMM)) {
+ if (!(msgflags & MFMM) || sender != NULL) {
fprintf(out, "%sSender: %s\n", resentstr, signature);
}
}