don't pass through NOTIFY= unless it was given in the SMTP RCPT
[unix-history] / usr / src / usr.sbin / sendmail / src / sendmail.h
index fceb113..b911e54 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)sendmail.h  8.66 (Berkeley) %G%
+ *     @(#)sendmail.h  8.106 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -15,7 +15,7 @@
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 8.66            %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 8.106           %G%";
 # endif
 # else /*  _DEFINE */
 # define EXTERN extern
 # endif
 # else /*  _DEFINE */
 # define EXTERN extern
@@ -27,10 +27,13 @@ static char SmailSccsId[] = "@(#)sendmail.h 8.66            %G%";
 # include <stdio.h>
 # include <ctype.h>
 # include <setjmp.h>
 # include <stdio.h>
 # include <ctype.h>
 # include <setjmp.h>
-# include <sysexits.h>
 # include <string.h>
 # include <time.h>
 # include <errno.h>
 # include <string.h>
 # include <time.h>
 # include <errno.h>
+# ifdef EX_OK
+#  undef EX_OK
+# endif
+# include <sysexits.h>
 
 # include "conf.h"
 # include "conf.h"
 
 # include "conf.h"
 # include "conf.h"
@@ -73,8 +76,8 @@ static char SmailSccsId[] =   "@(#)sendmail.h 8.66            %G%";
 #define BYTEBITS       8       /* number of bits in a byte */
 
 /* internal macros */
 #define BYTEBITS       8       /* number of bits in a byte */
 
 /* internal macros */
-#define _BITWORD(bit)  (bit / (BYTEBITS * sizeof (int)))
-#define _BITBIT(bit)   (1 << (bit % (BYTEBITS * sizeof (int))))
+#define _BITWORD(bit)  ((bit) / (BYTEBITS * sizeof (int)))
+#define _BITBIT(bit)   (1 << ((bit) % (BYTEBITS * sizeof (int))))
 
 typedef int    BITMAP[BITMAPBYTES / sizeof (int)];
 
 
 typedef int    BITMAP[BITMAPBYTES / sizeof (int)];
 
@@ -141,8 +144,7 @@ typedef struct address ADDRESS;
 # define QPINGONSUCCESS        0x00001000      /* give return on successful delivery */
 # define QPINGONFAILURE        0x00002000      /* give return on failure */
 # define QPINGONDELAY  0x00004000      /* give return on message delay */
 # define QPINGONSUCCESS        0x00001000      /* give return on successful delivery */
 # define QPINGONFAILURE        0x00002000      /* give return on failure */
 # define QPINGONDELAY  0x00004000      /* give return on message delay */
-# define QHASRETPARAM  0x00008000      /* RCPT command had RET argument */
-# define QNOBODYRETURN 0x00010000      /* don't return message body */
+# define QHASNOTIFY    0x00008000      /* propogate notify parameter */
 # define QRELAYED      0x00020000      /* relayed to non-DSN aware mailer */
 
 # define NULLADDR      ((ADDRESS *) NULL)
 # define QRELAYED      0x00020000      /* relayed to non-DSN aware mailer */
 
 # define NULLADDR      ((ADDRESS *) NULL)
@@ -163,6 +165,9 @@ struct mailer
 {
        char    *m_name;        /* symbolic name of this mailer */
        char    *m_mailer;      /* pathname of the mailer to use */
 {
        char    *m_name;        /* symbolic name of this mailer */
        char    *m_mailer;      /* pathname of the mailer to use */
+       char    *m_mtatype;     /* type of this MTA */
+       char    *m_addrtype;    /* type for addresses */
+       char    *m_diagtype;    /* type for diagnostics */
        BITMAP  m_flags;        /* status flags, see below */
        short   m_mno;          /* mailer number internally */
        char    **m_argv;       /* template argument vector */
        BITMAP  m_flags;        /* status flags, see below */
        short   m_mno;          /* mailer number internally */
        char    **m_argv;       /* template argument vector */
@@ -176,6 +181,7 @@ struct mailer
        char    *m_execdir;     /* directory to chdir to before execv */
        uid_t   m_uid;          /* UID to run as */
        gid_t   m_gid;          /* GID to run as */
        char    *m_execdir;     /* directory to chdir to before execv */
        uid_t   m_uid;          /* UID to run as */
        gid_t   m_gid;          /* GID to run as */
+       char    *m_defcharset;  /* default character set */
 };
 
 typedef struct mailer  MAILER;
 };
 
 typedef struct mailer  MAILER;
@@ -197,6 +203,7 @@ typedef struct mailer       MAILER;
 # define M_PREHEAD     'H'     /* MAIL11V3: preview headers */
 # define M_UDBENVELOPE 'i'     /* do udbsender rewriting on envelope */
 # define M_INTERNAL    'I'     /* SMTP to another sendmail site */
 # define M_PREHEAD     'H'     /* MAIL11V3: preview headers */
 # define M_UDBENVELOPE 'i'     /* do udbsender rewriting on envelope */
 # define M_INTERNAL    'I'     /* SMTP to another sendmail site */
+# define M_UDBRECIPIENT        'j'     /* do udbsender rewriting on recipient lines */
 # define M_NOLOOPCHECK 'k'     /* don't check for loops in HELO command */
 # define M_LOCALMAILER 'l'     /* delivery is to this host */
 # define M_LIMITS      'L'     /* must enforce SMTP line limits */
 # define M_NOLOOPCHECK 'k'     /* don't check for loops in HELO command */
 # define M_LOCALMAILER 'l'     /* delivery is to this host */
 # define M_LIMITS      'L'     /* must enforce SMTP line limits */
@@ -219,6 +226,7 @@ typedef struct mailer       MAILER;
 # define M_XDOT                'X'     /* use hidden-dot algorithm */
 # define M_TRYRULESET5 '5'     /* use ruleset 5 after local aliasing */
 # define M_7BITS       '7'     /* use 7-bit path */
 # define M_XDOT                'X'     /* use hidden-dot algorithm */
 # define M_TRYRULESET5 '5'     /* use ruleset 5 after local aliasing */
 # define M_7BITS       '7'     /* use 7-bit path */
+# define M_8BITS       '8'     /* force "just send 8" behaviour */
 # define M_CHECKINCLUDE        ':'     /* check for :include: files */
 # define M_CHECKPROG   '|'     /* check for |program addresses */
 # define M_CHECKFILE   '/'     /* check for /file addresses */
 # define M_CHECKINCLUDE        ':'     /* check for :include: files */
 # define M_CHECKPROG   '|'     /* check for |program addresses */
 # define M_CHECKFILE   '/'     /* check for /file addresses */
@@ -274,6 +282,8 @@ extern struct hdrinfo       HdrInfo[];
 # define H_RECEIPTTO   0x0400  /* this field has return receipt info */
 # define H_ERRORSTO    0x0800  /* this field has error address info */
 # define H_CTE         0x1000  /* this field is a content-transfer-encoding */
 # define H_RECEIPTTO   0x0400  /* this field has return receipt info */
 # define H_ERRORSTO    0x0800  /* this field has error address info */
 # define H_CTE         0x1000  /* this field is a content-transfer-encoding */
+# define H_CTYPE       0x2000  /* this is a content-type field */
+# define H_STRIPVAL    0x4000  /* strip value from header (Bcc:) */
 \f/*
 **  Information about currently open connections to mailers, or to
 **  hosts that we have looked up recently.
 \f/*
 **  Information about currently open connections to mailers, or to
 **  hosts that we have looked up recently.
@@ -295,6 +305,7 @@ MCI
        char            *mci_phase;     /* SMTP phase string */
        struct mailer   *mci_mailer;    /* ptr to the mailer for this conn */
        char            *mci_host;      /* host name */
        char            *mci_phase;     /* SMTP phase string */
        struct mailer   *mci_mailer;    /* ptr to the mailer for this conn */
        char            *mci_host;      /* host name */
+       char            *mci_status;    /* DSN status to be copied to addrs */
        time_t          mci_lastuse;    /* last usage time */
 };
 
        time_t          mci_lastuse;    /* last usage time */
 };
 
@@ -312,6 +323,7 @@ MCI
 #define MCIF_INHEADER  0x0200          /* currently outputing header */
 #define MCIF_CVT8TO7   0x0400          /* convert from 8 to 7 bits */
 #define MCIF_DSN       0x0800          /* DSN extension supported */
 #define MCIF_INHEADER  0x0200          /* currently outputing header */
 #define MCIF_CVT8TO7   0x0400          /* convert from 8 to 7 bits */
 #define MCIF_DSN       0x0800          /* DSN extension supported */
+#define MCIF_8BITOK    0x1000          /* OK to send 8 bit characters */
 
 /* states */
 #define MCIS_CLOSED    0               /* no traffic on this connection */
 
 /* states */
 #define MCIS_CLOSED    0               /* no traffic on this connection */
@@ -361,7 +373,6 @@ ENVELOPE
        struct envelope *e_parent;      /* the message this one encloses */
        struct envelope *e_sibling;     /* the next envelope of interest */
        char            *e_bodytype;    /* type of message body */
        struct envelope *e_parent;      /* the message this one encloses */
        struct envelope *e_sibling;     /* the next envelope of interest */
        char            *e_bodytype;    /* type of message body */
-       char            *e_df;          /* location of temp file */
        FILE            *e_dfp;         /* temporary file */
        char            *e_id;          /* code for this entry in queue */
        FILE            *e_xfp;         /* transcript file */
        FILE            *e_dfp;         /* temporary file */
        char            *e_id;          /* code for this entry in queue */
        FILE            *e_xfp;         /* transcript file */
@@ -382,7 +393,7 @@ ENVELOPE
 /* values for e_flags */
 #define EF_OLDSTYLE    0x0000001       /* use spaces (not commas) in hdrs */
 #define EF_INQUEUE     0x0000002       /* this message is fully queued */
 /* values for e_flags */
 #define EF_OLDSTYLE    0x0000001       /* use spaces (not commas) in hdrs */
 #define EF_INQUEUE     0x0000002       /* this message is fully queued */
-#define EF_NORETURN    0x0000004       /* don't return the message on error */
+#define EF_NO_BODY_RETN        0x0000004       /* omit message body on error */
 #define EF_CLRQUEUE    0x0000008       /* disk copy is no longer needed */
 #define EF_SENDRECEIPT 0x0000010       /* send a return receipt */
 #define EF_FATALERRS   0x0000020       /* fatal errors occured */
 #define EF_CLRQUEUE    0x0000008       /* disk copy is no longer needed */
 #define EF_SENDRECEIPT 0x0000010       /* send a return receipt */
 #define EF_FATALERRS   0x0000020       /* fatal errors occured */
@@ -400,6 +411,8 @@ ENVELOPE
 #define EF_HAS8BIT     0x0020000       /* at least one 8-bit char in body */
 #define EF_NL_NOT_EOL  0x0040000       /* don't accept raw NL as EOLine */
 #define EF_CRLF_NOT_EOL        0x0080000       /* don't accept CR-LF as EOLine */
 #define EF_HAS8BIT     0x0020000       /* at least one 8-bit char in body */
 #define EF_NL_NOT_EOL  0x0040000       /* don't accept raw NL as EOLine */
 #define EF_CRLF_NOT_EOL        0x0080000       /* don't accept CR-LF as EOLine */
+#define EF_RET_PARAM   0x0100000       /* RCPT command had RET argument */
+#define EF_HAS_DF      0x0200000       /* set when df file is instantiated */
 
 EXTERN ENVELOPE        *CurEnv;        /* envelope currently being processed */
 \f/*
 
 EXTERN ENVELOPE        *CurEnv;        /* envelope currently being processed */
 \f/*
@@ -456,37 +469,37 @@ EXTERN struct rewrite     *RewriteRules[MAXRWSETS];
 */
 
 /* left hand side items */
 */
 
 /* left hand side items */
-# define MATCHZANY     0220    /* match zero or more tokens */
-# define MATCHANY      0221    /* match one or more tokens */
-# define MATCHONE      0222    /* match exactly one token */
-# define MATCHCLASS    0223    /* match one token in a class */
-# define MATCHNCLASS   0224    /* match anything not in class */
-# define MATCHREPL     0225    /* replacement on RHS for above */
+# define MATCHZANY     ((u_char)0220)  /* match zero or more tokens */
+# define MATCHANY      ((u_char)0221)  /* match one or more tokens */
+# define MATCHONE      ((u_char)0222)  /* match exactly one token */
+# define MATCHCLASS    ((u_char)0223)  /* match one token in a class */
+# define MATCHNCLASS   ((u_char)0224)  /* match anything not in class */
+# define MATCHREPL     ((u_char)0225)  /* replacement on RHS for above */
 # define MATCHLOOKUP   '\035'  /* look up and replace a sequence */
 # define MATCHELOOKUP  '\036'  /* end of the sequence */
 
 /* right hand side items */
 # define MATCHLOOKUP   '\035'  /* look up and replace a sequence */
 # define MATCHELOOKUP  '\036'  /* end of the sequence */
 
 /* right hand side items */
-# define CANONNET      0226    /* canonical net, next token */
-# define CANONHOST     0227    /* canonical host, next token */
-# define CANONUSER     0230    /* canonical user, next N tokens */
-# define CALLSUBR      0231    /* call another rewriting set */
+# define CANONNET      ((u_char)0226)  /* canonical net, next token */
+# define CANONHOST     ((u_char)0227)  /* canonical host, next token */
+# define CANONUSER     ((u_char)0230)  /* canonical user, next N tokens */
+# define CALLSUBR      ((u_char)0231)  /* call another rewriting set */
 
 /* conditionals in macros */
 
 /* conditionals in macros */
-# define CONDIF                0232    /* conditional if-then */
-# define CONDELSE      0233    /* conditional else */
-# define CONDFI                0234    /* conditional fi */
+# define CONDIF                ((u_char)0232)  /* conditional if-then */
+# define CONDELSE      ((u_char)0233)  /* conditional else */
+# define CONDFI                ((u_char)0234)  /* conditional fi */
 
 /* bracket characters for host name lookup */
 
 /* bracket characters for host name lookup */
-# define HOSTBEGIN     0235    /* hostname lookup begin */
-# define HOSTEND       0236    /* hostname lookup end */
+# define HOSTBEGIN     ((u_char)0235)  /* hostname lookup begin */
+# define HOSTEND       ((u_char)0236)  /* hostname lookup end */
 
 /* bracket characters for generalized lookup */
 
 /* bracket characters for generalized lookup */
-# define LOOKUPBEGIN   0205    /* generalized lookup begin */
-# define LOOKUPEND     0206    /* generalized lookup end */
+# define LOOKUPBEGIN   ((u_char)0205)  /* generalized lookup begin */
+# define LOOKUPEND     ((u_char)0206)  /* generalized lookup end */
 
 /* macro substitution character */
 
 /* macro substitution character */
-# define MACROEXPAND   0201    /* macro expansion */
-# define MACRODEXPAND  0202    /* deferred macro expansion */
+# define MACROEXPAND   ((u_char)0201)  /* macro expansion */
+# define MACRODEXPAND  ((u_char)0202)  /* deferred macro expansion */
 
 /* to make the code clearer */
 # define MATCHZERO     CANONHOST
 
 /* to make the code clearer */
 # define MATCHZERO     CANONHOST
@@ -529,6 +542,7 @@ NAMECANON
 
 # define MAPCLASS      struct _mapclass
 # define MAP           struct _map
 
 # define MAPCLASS      struct _mapclass
 # define MAP           struct _map
+# define MAXMAPACTIONS 3               /* size of map_actions array */
 
 
 /*
 
 
 /*
@@ -539,7 +553,7 @@ MAP
 {
        MAPCLASS        *map_class;     /* the class of this map */
        char            *map_mname;     /* name of this map */
 {
        MAPCLASS        *map_class;     /* the class of this map */
        char            *map_mname;     /* name of this map */
-       int             map_mflags;     /* flags, see below */
+       long            map_mflags;     /* flags, see below */
        char            *map_file;      /* the (nominal) filename */
        ARBPTR_T        map_db1;        /* the open database ptr */
        ARBPTR_T        map_db2;        /* an "extra" database pointer */
        char            *map_file;      /* the (nominal) filename */
        ARBPTR_T        map_db1;        /* the open database ptr */
        ARBPTR_T        map_db2;        /* an "extra" database pointer */
@@ -552,26 +566,27 @@ MAP
        char            *map_domain;    /* the (nominal) NIS domain */
        char            *map_rebuild;   /* program to run to do auto-rebuild */
        time_t          map_mtime;      /* last database modification time */
        char            *map_domain;    /* the (nominal) NIS domain */
        char            *map_rebuild;   /* program to run to do auto-rebuild */
        time_t          map_mtime;      /* last database modification time */
-       MAP             *map_stack[MAXMAPSTACK]; /* list for stacked maps */
-       short           map_return[3];  /* return bitmaps for stacked maps */
+       MAP             *map_stack[MAXMAPSTACK];   /* list for stacked maps */
+       short           map_return[MAXMAPACTIONS]; /* return bitmaps for stacked maps */
 };
 
 };
 
-/* bit values for map_flags */
-# define MF_VALID      0x0001          /* this entry is valid */
-# define MF_INCLNULL   0x0002          /* include null byte in key */
-# define MF_OPTIONAL   0x0004          /* don't complain if map not found */
-# define MF_NOFOLDCASE 0x0008          /* don't fold case in keys */
-# define MF_MATCHONLY  0x0010          /* don't use the map value */
-# define MF_OPEN       0x0020          /* this entry is open */
-# define MF_WRITABLE   0x0040          /* open for writing */
-# define MF_ALIAS      0x0080          /* this is an alias file */
-# define MF_TRY0NULL   0x0100          /* try with no null byte */
-# define MF_TRY1NULL   0x0200          /* try with the null byte */
-# define MF_LOCKED     0x0400          /* this map is currently locked */
-# define MF_ALIASWAIT  0x0800          /* alias map in aliaswait state */
-# define MF_IMPL_HASH  0x1000          /* implicit: underlying hash database */
-# define MF_IMPL_NDBM  0x2000          /* implicit: underlying NDBM database */
-# define MF_UNSAFEDB   0x4000          /* this map is world writable */
+/* bit values for map_mflags */
+# define MF_VALID      0x00000001      /* this entry is valid */
+# define MF_INCLNULL   0x00000002      /* include null byte in key */
+# define MF_OPTIONAL   0x00000004      /* don't complain if map not found */
+# define MF_NOFOLDCASE 0x00000008      /* don't fold case in keys */
+# define MF_MATCHONLY  0x00000010      /* don't use the map value */
+# define MF_OPEN       0x00000020      /* this entry is open */
+# define MF_WRITABLE   0x00000040      /* open for writing */
+# define MF_ALIAS      0x00000080      /* this is an alias file */
+# define MF_TRY0NULL   0x00000100      /* try with no null byte */
+# define MF_TRY1NULL   0x00000200      /* try with the null byte */
+# define MF_LOCKED     0x00000400      /* this map is currently locked */
+# define MF_ALIASWAIT  0x00000800      /* alias map in aliaswait state */
+# define MF_IMPL_HASH  0x00001000      /* implicit: underlying hash database */
+# define MF_IMPL_NDBM  0x00002000      /* implicit: underlying NDBM database */
+# define MF_UNSAFEDB   0x00004000      /* this map is world writable */
+# define MF_APPEND     0x00008000      /* append new entry on rebuiled */
 
 /* indices for map_actions */
 # define MA_NOTFOUND   0               /* member map returned "not found" */
 
 /* indices for map_actions */
 # define MA_NOTFOUND   0               /* member map returned "not found" */
@@ -603,6 +618,7 @@ MAPCLASS
 #define MCF_ALIASOK    0x0001          /* can be used for aliases */
 #define MCF_ALIASONLY  0x0002          /* usable only for aliases */
 #define MCF_REBUILDABLE        0x0004          /* can rebuild alias files */
 #define MCF_ALIASOK    0x0001          /* can be used for aliases */
 #define MCF_ALIASONLY  0x0002          /* usable only for aliases */
 #define MCF_REBUILDABLE        0x0004          /* can rebuild alias files */
+#define MCF_OPTFILE    0x0008          /* file name is optional */
 \f/*
 **  Symbol table definitions
 */
 \f/*
 **  Symbol table definitions
 */
@@ -624,6 +640,7 @@ struct symtab
                MCI             sv_mci;         /* mailer connection info */
                NAMECANON       sv_namecanon;   /* canonical name cache */
                int             sv_macro;       /* macro name => id mapping */
                MCI             sv_mci;         /* mailer connection info */
                NAMECANON       sv_namecanon;   /* canonical name cache */
                int             sv_macro;       /* macro name => id mapping */
+               int             sv_ruleset;     /* ruleset index */
        }       s_value;
 };
 
        }       s_value;
 };
 
@@ -640,6 +657,7 @@ typedef struct symtab       STAB;
 # define ST_HOSTSIG    7       /* host signature */
 # define ST_NAMECANON  8       /* cached canonical name */
 # define ST_MACRO      9       /* macro name to id mapping */
 # define ST_HOSTSIG    7       /* host signature */
 # define ST_NAMECANON  8       /* cached canonical name */
 # define ST_MACRO      9       /* macro name to id mapping */
+# define ST_RULESET    10      /* ruleset index */
 # define ST_MCI                16      /* mailer connection info (offset) */
 
 # define s_class       s_value.sv_class
 # define ST_MCI                16      /* mailer connection info (offset) */
 
 # define s_class       s_value.sv_class
@@ -666,7 +684,7 @@ extern void         stabapply __P((void (*)(STAB *, int), int));
 struct event
 {
        time_t          ev_time;        /* time of the function call */
 struct event
 {
        time_t          ev_time;        /* time of the function call */
-       int             (*ev_func)__P((int));
+       void            (*ev_func)__P((int));
                                        /* function to call */
        int             ev_arg;         /* argument to ev_func */
        int             ev_pid;         /* pid that set this event */
                                        /* function to call */
        int             ev_arg;         /* argument to ev_func */
        int             ev_pid;         /* pid that set this event */
@@ -731,6 +749,22 @@ EXTERN int MimeMode;
 #define MM_CVTMIME     0x0001          /* convert 8 to 7 bit MIME */
 #define MM_PASS8BIT    0x0002          /* just send 8 bit data blind */
 #define MM_MIME8BIT    0x0004          /* convert 8-bit data to MIME */
 #define MM_CVTMIME     0x0001          /* convert 8 to 7 bit MIME */
 #define MM_PASS8BIT    0x0002          /* just send 8 bit data blind */
 #define MM_MIME8BIT    0x0004          /* convert 8-bit data to MIME */
+
+/* queue sorting order algorithm */
+EXTERN int     QueueSortOrder;
+
+#define QS_BYPRIORITY  0               /* sort by message priority */
+#define QS_BYHOST      1               /* sort by first host name */
+
+
+/* how to handle messages without any recipient addresses */
+EXTERN int             NoRecipientAction;
+
+#define NRA_NO_ACTION          0       /* just leave it as is */
+#define NRA_ADD_TO             1       /* add To: header */
+#define NRA_ADD_APPARENTLY_TO  2       /* add Apparently-To: header */
+#define NRA_ADD_BCC            3       /* add empty Bcc: header */
+#define NRA_ADD_TO_UNDISCLOSED 4       /* add To: undisclosed:; header */
 \f/*
 **  Additional definitions
 */
 \f/*
 **  Additional definitions
 */
@@ -783,6 +817,21 @@ struct prival
 #define SFF_MUSTOWN            0x0001  /* user must own this file */
 #define SFF_NOSLINK            0x0002  /* file cannot be a symbolic link */
 #define SFF_ROOTOK             0x0004  /* ok for root to own this file */
 #define SFF_MUSTOWN            0x0001  /* user must own this file */
 #define SFF_NOSLINK            0x0002  /* file cannot be a symbolic link */
 #define SFF_ROOTOK             0x0004  /* ok for root to own this file */
+#define SFF_NOPATHCHECK                0x0010  /* don't bother checking dir path */
+#define SFF_SETUIDOK           0x0020  /* setuid files are ok */
+#define SFF_CREAT              0x0040  /* ok to create file if necessary */
+#define SFF_REGONLY            0x0080  /* regular files only */
+
+/* flags that are actually specific to safefopen */
+#define SFF_OPENASROOT         0x1000  /* open as root instead of real user */
+
+
+/*
+**  Flags passed to mime8to7.
+*/
+
+#define M87F_OUTER             0       /* outer context */
+#define M87F_NO8BIT            0x0001  /* can't have 8-bit in this section */
 
 
 /*
 
 
 /*
@@ -850,7 +899,8 @@ EXTERN bool ForkQueueRuns;  /* fork for each job when running the queue */
 EXTERN bool    AutoRebuild;    /* auto-rebuild the alias database as needed */
 EXTERN bool    CheckAliases;   /* parse addresses during newaliases */
 EXTERN bool    NoAlias;        /* suppress aliasing */
 EXTERN bool    AutoRebuild;    /* auto-rebuild the alias database as needed */
 EXTERN bool    CheckAliases;   /* parse addresses during newaliases */
 EXTERN bool    NoAlias;        /* suppress aliasing */
-EXTERN bool    UseNameServer;  /* use internet domain name server */
+EXTERN bool    UseNameServer;  /* using DNS -- interpret h_errno & MX RRs */
+EXTERN bool    UseHesiod;      /* using Hesiod -- interpret Hesiod errors */
 EXTERN bool    SevenBitInput;  /* force 7-bit data on input */
 EXTERN bool    HasEightBits;   /* has at least one eight bit input byte */
 EXTERN time_t  SafeAlias;      /* interval to wait until @:@ in alias file */
 EXTERN bool    SevenBitInput;  /* force 7-bit data on input */
 EXTERN bool    HasEightBits;   /* has at least one eight bit input byte */
 EXTERN time_t  SafeAlias;      /* interval to wait until @:@ in alias file */
@@ -864,7 +914,6 @@ EXTERN char *DefUser;       /* default user to run as (from DefUid) */
 EXTERN int     OldUmask;       /* umask when sendmail starts up */
 EXTERN int     Errors;         /* set if errors (local to single pass) */
 EXTERN int     ExitStat;       /* exit status code */
 EXTERN int     OldUmask;       /* umask when sendmail starts up */
 EXTERN int     Errors;         /* set if errors (local to single pass) */
 EXTERN int     ExitStat;       /* exit status code */
-EXTERN int     AliasLevel;     /* depth of aliasing */
 EXTERN int     LineNumber;     /* line number in current input */
 EXTERN int     LogLevel;       /* level of logging to perform */
 EXTERN int     FileMode;       /* mode on files */
 EXTERN int     LineNumber;     /* line number in current input */
 EXTERN int     LogLevel;       /* level of logging to perform */
 EXTERN int     FileMode;       /* mode on files */
@@ -910,6 +959,8 @@ EXTERN char *FallBackMX;    /* fall back MX host */
 EXTERN long    MaxMessageSize; /* advertised max size we will accept */
 EXTERN time_t  MaxHostStatAge; /* max age of cached host status info */
 EXTERN time_t  MinQueueAge;    /* min delivery interval */
 EXTERN long    MaxMessageSize; /* advertised max size we will accept */
 EXTERN time_t  MaxHostStatAge; /* max age of cached host status info */
 EXTERN time_t  MinQueueAge;    /* min delivery interval */
+EXTERN time_t  DialDelay;      /* delay between dial-on-demand tries */
+EXTERN char    *SafeFileEnv;   /* chroot location for file delivery */
 EXTERN char    *ServiceSwitchFile;     /* backup service switch */
 EXTERN char    *DefaultCharSet;        /* default character set for MIME */
 EXTERN int     DeliveryNiceness;       /* how nice to be during delivery */
 EXTERN char    *ServiceSwitchFile;     /* backup service switch */
 EXTERN char    *DefaultCharSet;        /* default character set for MIME */
 EXTERN int     DeliveryNiceness;       /* how nice to be during delivery */
@@ -917,7 +968,6 @@ EXTERN char *PostMasterCopy;        /* address to get errs cc's */
 EXTERN int     CheckpointInterval;     /* queue file checkpoint interval */
 EXTERN bool    DontPruneRoutes;        /* don't prune source routes */
 EXTERN bool    BrokenSmtpPeers;        /* peers can't handle 2-line greeting */
 EXTERN int     CheckpointInterval;     /* queue file checkpoint interval */
 EXTERN bool    DontPruneRoutes;        /* don't prune source routes */
 EXTERN bool    BrokenSmtpPeers;        /* peers can't handle 2-line greeting */
-EXTERN bool    SortQueueByHost;        /* order queue by host name first */
 EXTERN int     MaxMciCache;            /* maximum entries in MCI cache */
 EXTERN time_t  MciCacheTimeout;        /* maximum idle time on connections */
 EXTERN char    *QueueLimitRecipient;   /* limit queue runs to this recipient */
 EXTERN int     MaxMciCache;            /* maximum entries in MCI cache */
 EXTERN time_t  MciCacheTimeout;        /* maximum idle time on connections */
 EXTERN char    *QueueLimitRecipient;   /* limit queue runs to this recipient */
@@ -999,13 +1049,13 @@ extern ADDRESS           *parseaddr __P((char *, ADDRESS *, int, int, char **, ENVELOPE *
 extern char            *xalloc __P((int));
 extern bool            sameaddr __P((ADDRESS *, ADDRESS *));
 extern FILE            *dfopen __P((char *, int, int));
 extern char            *xalloc __P((int));
 extern bool            sameaddr __P((ADDRESS *, ADDRESS *));
 extern FILE            *dfopen __P((char *, int, int));
-extern EVENT           *setevent __P((time_t, int(*)(), int));
+extern EVENT           *setevent __P((time_t, void(*)(), int));
 extern char            *sfgets __P((char *, int, FILE *, time_t, char *));
 extern char            *queuename __P((ENVELOPE *, int));
 extern time_t          curtime __P(());
 extern bool            transienterror __P((int));
 extern const char      *errstring __P((int));
 extern char            *sfgets __P((char *, int, FILE *, time_t, char *));
 extern char            *queuename __P((ENVELOPE *, int));
 extern time_t          curtime __P(());
 extern bool            transienterror __P((int));
 extern const char      *errstring __P((int));
-extern void            expand __P((char *, char *, char *, ENVELOPE *));
+extern void            expand __P((char *, char *, size_t, ENVELOPE *));
 extern void            define __P((int, char *, ENVELOPE *));
 extern char            *macvalue __P((int, ENVELOPE *));
 extern char            *macname __P((int));
 extern void            define __P((int, char *, ENVELOPE *));
 extern char            *macvalue __P((int, ENVELOPE *));
 extern char            *macname __P((int));
@@ -1013,7 +1063,7 @@ extern int                macid __P((char *, char **));
 extern char            **prescan __P((char *, int, char[], int, char **));
 extern int             rewrite __P((char **, int, int, ENVELOPE *));
 extern char            *fgetfolded __P((char *, int, FILE *));
 extern char            **prescan __P((char *, int, char[], int, char **));
 extern int             rewrite __P((char **, int, int, ENVELOPE *));
 extern char            *fgetfolded __P((char *, int, FILE *));
-extern ADDRESS         *recipient __P((ADDRESS *, ADDRESS **, ENVELOPE *));
+extern ADDRESS         *recipient __P((ADDRESS *, ADDRESS **, int, ENVELOPE *));
 extern ENVELOPE                *newenvelope __P((ENVELOPE *, ENVELOPE *));
 extern void            dropenvelope __P((ENVELOPE *));
 extern void            clearenvelope __P((ENVELOPE *, int));
 extern ENVELOPE                *newenvelope __P((ENVELOPE *, ENVELOPE *));
 extern void            dropenvelope __P((ENVELOPE *));
 extern void            clearenvelope __P((ENVELOPE *, int));
@@ -1034,6 +1084,19 @@ extern char              *shortenstring __P((char *, int));
 extern bool            usershellok __P((char *));
 extern void            commaize __P((HDR *, char *, int, MCI *, ENVELOPE *));
 extern char            *hvalue __P((char *, HDR *));
 extern bool            usershellok __P((char *));
 extern void            commaize __P((HDR *, char *, int, MCI *, ENVELOPE *));
 extern char            *hvalue __P((char *, HDR *));
+extern char            *defcharset __P((ENVELOPE *));
+extern bool            emptyaddr __P((ADDRESS *));
+extern int             sendtolist __P((char *, ADDRESS *, ADDRESS **, int, ENVELOPE *));
+extern bool            wordinclass __P((char *, int));
+extern char            *denlstring __P((char *, int, int));
+extern void            printaddr __P((ADDRESS *, bool));
+extern void            makelower __P((char *));
+extern void            rebuildaliases __P((MAP *, bool));
+extern void            readaliases __P((MAP *, FILE *, bool, bool));
+extern void            finis __P(());
+extern void            clrevent __P((EVENT *));
+extern void            setsender __P((char *, ENVELOPE *, char **, bool));
+extern FILE            *safefopen __P((char *, int, int, int));
 
 /* ellipsis is a different case though */
 #ifdef __STDC__
 
 /* ellipsis is a different case though */
 #ifdef __STDC__