the message as being resent); ignore incoming From: lines if their text
exactly matches our machine-readable address exactly -- this causes the
full name to be added when called from (e.g.) MH. Both of these mode are
to improve interaction with MH.
SCCS-mr: usr.sbin/sendmail/src/headers.c 201
SCCS-mr: usr.sbin/sendmail/src/version.c 201
SCCS-mr: usr.sbin/sendmail/src/sendmail.h 201
SCCS-mr: usr.sbin/sendmail/src/conf.c 201
SCCS-vsn: usr.sbin/sendmail/src/headers.c 3.53
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.322
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 3.116
SCCS-vsn: usr.sbin/sendmail/src/conf.c 3.70
-SCCSID(@(#)conf.c 3.69 %G%);
+SCCSID(@(#)conf.c 3.70 %G%);
\f/*
** Header info table
** Final (null) entry contains the flags used for any other field.
\f/*
** Header info table
** Final (null) entry contains the flags used for any other field.
struct hdrinfo HdrInfo[] =
{
/* originator fields, most to least significant */
struct hdrinfo HdrInfo[] =
{
/* originator fields, most to least significant */
- "resent-sender", H_FROM,
- "resent-from", H_FROM,
+ "resent-sender", H_FROM|H_RESENT,
+ "resent-from", H_FROM|H_RESENT,
"sender", H_FROM,
"from", H_FROM,
"full-name", H_ACHECK,
"sender", H_FROM,
"from", H_FROM,
"full-name", H_ACHECK,
"errors-to", H_FROM,
/* destination fields */
"to", H_RCPT,
"errors-to", H_FROM,
/* destination fields */
"to", H_RCPT,
+ "resent-to", H_RCPT|H_RESENT,
+ "resent-cc", H_RCPT|H_RESENT,
- "resent-bcc", H_RCPT|H_ACHECK,
+ "resent-bcc", H_RCPT|H_ACHECK|H_RESENT,
/* message identification and control */
/* message identification and control */
+ "message-id", 0,
+ "resent-message-id", H_RESENT,
"message", H_EOH,
"text", H_EOH,
"message", H_EOH,
"text", H_EOH,
+ /* date fields */
+ "date", 0,
+ "resent-date", H_RESENT,
/* trace fields */
"received", H_TRACE|H_FORCE,
"via", H_TRACE|H_FORCE,
/* trace fields */
"received", H_TRACE|H_FORCE,
"via", H_TRACE|H_FORCE,
# include <errno.h>
# include "sendmail.h"
# include <errno.h>
# include "sendmail.h"
-SCCSID(@(#)headers.c 3.52 %G%);
+SCCSID(@(#)headers.c 3.53 %G%);
/*
** CHOMPHEADER -- process and save a header line.
/*
** CHOMPHEADER -- process and save a header line.
+ /* see if this is a resent message */
+ if (!def && bitset(H_RESENT, h->h_flags))
+ CurEnv->e_flags |= EF_RESENT;
+
/* if this means "end of header" quit now */
if (bitset(H_EOH, hi->hi_flags))
return (hi->hi_flags);
/* if this means "end of header" quit now */
if (bitset(H_EOH, hi->hi_flags))
return (hi->hi_flags);
+ /* drop explicit From: if same as what we would generate -- for MH */
+ if (!def && strcmp(fvalue, CurEnv->e_from.q_paddr) == 0)
+ {
+ p = "resent-from";
+ if (!bitset(EF_RESENT, CurEnv->e_flags))
+ p += 7;
+ if (strcmp(fname, p) == 0)
+ return (hi->hi_flags);
+ }
+
/* create/fill in a new node */
if (h == NULL || bitset(H_FORCE, h->h_flags))
{
/* create/fill in a new node */
if (h == NULL || bitset(H_FORCE, h->h_flags))
{
CurEnv->e_flags &= ~EF_OLDSTYLE;
}
CurEnv->e_flags &= ~EF_OLDSTYLE;
}
- /* send to this person if we so desire */
- if (!def && GrabTo && bitset(H_RCPT, h->h_flags))
- sendtolist(h->h_value, (ADDRESS *) NULL, &CurEnv->e_sendqueue);
-
return (h->h_flags);
}
\f/*
return (h->h_flags);
}
\f/*
if (tTd(32, 1))
printf("%s: %s\n", capitalize(h->h_field), h->h_value);
#endif DEBUG
if (tTd(32, 1))
printf("%s: %s\n", capitalize(h->h_field), h->h_value);
#endif DEBUG
+ /* count the number of times it has been processed */
if (bitset(H_TRACE, h->h_flags))
hopcnt++;
if (bitset(H_TRACE, h->h_flags))
hopcnt++;
+
+ /* send to this person if we so desire */
+ if (GrabTo && bitset(H_RCPT, h->h_flags) &&
+ !bitset(H_DEFAULT, h->h_flags) &&
+ (!bitset(EF_RESENT, CurEnv->e_flags) || bitset(H_RESENT, h->h_flags)))
+ {
+ sendtolist(h->h_value, (ADDRESS *) NULL, &CurEnv->e_sendqueue);
+ }
+
+ /* log the message-id */
#ifdef LOG
if (!QueueRun && LogLevel > 8 &&
strcmp(h->h_field, "message-id") == 0)
#ifdef LOG
if (!QueueRun && LogLevel > 8 &&
strcmp(h->h_field, "message-id") == 0)
!bitintersect(h->h_mflags, m->m_flags))
continue;
!bitintersect(h->h_mflags, m->m_flags))
continue;
+ /* handle Resent-... headers specially */
+ if (bitset(H_RESENT, h->h_flags) && !bitset(EF_RESENT, e->e_flags))
+ continue;
+
p = h->h_value;
if (bitset(H_DEFAULT, h->h_flags))
{
p = h->h_value;
if (bitset(H_DEFAULT, h->h_flags))
{
# ifdef _DEFINE
# define EXTERN
# ifndef lint
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 3.115 %G%";
+static char SmailSccsId[] = "@(#)sendmail.h 3.116 %G%";
# endif lint
# else _DEFINE
# define EXTERN extern
# endif lint
# else _DEFINE
# define EXTERN extern
# define H_EOH 00001 /* this field terminates header */
# define H_RCPT 00002 /* contains recipient addresses */
# define H_DEFAULT 00004 /* if another value is found, drop this */
# define H_EOH 00001 /* this field terminates header */
# define H_RCPT 00002 /* contains recipient addresses */
# define H_DEFAULT 00004 /* if another value is found, drop this */
-# define H_RESENT 00010 /* this address is a "resent-..." address */
+# define H_RESENT 00010 /* this address is a "Resent-..." address */
# define H_CHECK 00020 /* check h_mflags against m_flags */
# define H_ACHECK 00040 /* ditto, but always (not just default) */
# define H_FORCE 00100 /* force this field, even if default */
# define H_CHECK 00020 /* check h_mflags against m_flags */
# define H_ACHECK 00040 /* ditto, but always (not just default) */
# define H_FORCE 00100 /* force this field, even if default */
#define EF_FATALERRS 000040 /* fatal errors occured */
#define EF_KEEPQUEUE 000100 /* keep queue files always */
#define EF_RESPONSE 000200 /* this is an error or return receipt */
#define EF_FATALERRS 000040 /* fatal errors occured */
#define EF_KEEPQUEUE 000100 /* keep queue files always */
#define EF_RESPONSE 000200 /* this is an error or return receipt */
+#define EF_RESENT 000400 /* this message is being forwarded */
EXTERN ENVELOPE *CurEnv; /* envelope currently being processed */
\f/*
EXTERN ENVELOPE *CurEnv; /* envelope currently being processed */
\f/*
-static char SccsId[] = "@(#)SendMail version 3.321 of %G%";
+static char SccsId[] = "@(#)SendMail version 3.322 of %G%";
-char Version[] = "3.321";
+char Version[] = "3.322";