put getcanonname into service switch
[unix-history] / usr / src / usr.sbin / sendmail / src / sendmail.h
index ed606c9..b63fcbc 100644 (file)
@@ -1,11 +1,11 @@
 /*
 /*
- * Copyright (c) 1983 Eric P. Allman
+ * Copyright (c) 1983, 1995 Eric P. Allman
  * Copyright (c) 1988, 1993
  *     The Regents of the University of California.  All rights reserved.
  *
  * %sccs.include.redist.c%
  *
  * Copyright (c) 1988, 1993
  *     The Regents of the University of California.  All rights reserved.
  *
  * %sccs.include.redist.c%
  *
- *     @(#)sendmail.h  8.115 (Berkeley) %G%
+ *     @(#)sendmail.h  8.132 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -15,7 +15,7 @@
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 8.115           %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 8.132           %G%";
 # endif
 # else /*  _DEFINE */
 # define EXTERN extern
 # endif
 # else /*  _DEFINE */
 # define EXTERN extern
@@ -31,7 +31,7 @@ static char SmailSccsId[] =   "@(#)sendmail.h 8.115           %G%";
 # include <time.h>
 # include <errno.h>
 # ifdef EX_OK
 # include <time.h>
 # include <errno.h>
 # ifdef EX_OK
-#  undef EX_OK                 /* for IRIX 5.3 and up */
+#  undef EX_OK                 /* for SVr4.2 SMP */
 # endif
 # include <sysexits.h>
 
 # endif
 # include <sysexits.h>
 
@@ -138,15 +138,16 @@ typedef struct address ADDRESS;
 # define QNOTREMOTE    0x00000040      /* address not for remote forwarding */
 # define QSELFREF      0x00000080      /* this address references itself */
 # define QVERIFIED     0x00000100      /* verified, but not expanded */
 # define QNOTREMOTE    0x00000040      /* address not for remote forwarding */
 # define QSELFREF      0x00000080      /* this address references itself */
 # define QVERIFIED     0x00000100      /* verified, but not expanded */
-# define QREPORT       0x00000200      /* report this addr in return message */
 # define QBOGUSSHELL   0x00000400      /* user has no valid shell listed */
 # define QUNSAFEADDR   0x00000800      /* address aquired via unsafe path */
 # define QPINGONSUCCESS        0x00001000      /* give return on successful delivery */
 # define QPINGONFAILURE        0x00002000      /* give return on failure */
 # define QPINGONDELAY  0x00004000      /* give return on message delay */
 # define QHASNOTIFY    0x00008000      /* propogate notify parameter */
 # define QBOGUSSHELL   0x00000400      /* user has no valid shell listed */
 # define QUNSAFEADDR   0x00000800      /* address aquired via unsafe path */
 # define QPINGONSUCCESS        0x00001000      /* give return on successful delivery */
 # define QPINGONFAILURE        0x00002000      /* give return on failure */
 # define QPINGONDELAY  0x00004000      /* give return on message delay */
 # define QHASNOTIFY    0x00008000      /* propogate notify parameter */
-# define QRELAYED      0x00010000      /* relayed to non-DSN aware mailer */
-# define QEXPLODED     0x00020000      /* undergone mailing list explosion */
+# define QRELAYED      0x00010000      /* DSN: relayed to non-DSN aware sys */
+# define QEXPANDED     0x00020000      /* DSN: undergone list expansion */
+# define QDELIVERED    0x00040000      /* DSN: successful final delivery */
+# define QDELAYED      0x00080000      /* DSN: message delayed */
 # define QTHISPASS     0x80000000      /* temp: address set this pass */
 
 # define NULLADDR      ((ADDRESS *) NULL)
 # define QTHISPASS     0x80000000      /* temp: address set this pass */
 
 # define NULLADDR      ((ADDRESS *) NULL)
@@ -172,6 +173,7 @@ struct mailer
        char    *m_diagtype;    /* type for diagnostics */
        BITMAP  m_flags;        /* status flags, see below */
        short   m_mno;          /* mailer number internally */
        char    *m_diagtype;    /* type for diagnostics */
        BITMAP  m_flags;        /* status flags, see below */
        short   m_mno;          /* mailer number internally */
+       short   m_nice;         /* niceness to run at (mostly for prog) */
        char    **m_argv;       /* template argument vector */
        short   m_sh_rwset;     /* rewrite set: sender header addresses */
        short   m_se_rwset;     /* rewrite set: sender envelope addresses */
        char    **m_argv;       /* template argument vector */
        short   m_sh_rwset;     /* rewrite set: sender header addresses */
        short   m_se_rwset;     /* rewrite set: sender envelope addresses */
@@ -227,9 +229,11 @@ typedef struct mailer      MAILER;
 # define M_HASPWENT    'w'     /* check for /etc/passwd entry */
                /*      'x'     /* CF: include Full-Name: */
 # define M_XDOT                'X'     /* use hidden-dot algorithm */
 # define M_HASPWENT    'w'     /* check for /etc/passwd entry */
                /*      'x'     /* CF: include Full-Name: */
 # define M_XDOT                'X'     /* use hidden-dot algorithm */
+# define M_EBCDIC      '3'     /* extend Q-P encoding for EBCDIC */
 # 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_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_MAKE8BIT    '9'     /* convert 7 -> 8 bit if appropriate */
 # 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 */
@@ -327,6 +331,8 @@ MCI
 #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 */
 #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 */
+#define MCIF_CVT7TO8   0x2000          /* convert from 7 to 8 bits */
+#define MCIF_INMIME    0x4000          /* currently reading MIME header */
 
 /* states */
 #define MCIS_CLOSED    0               /* no traffic on this connection */
 
 /* states */
 #define MCIS_CLOSED    0               /* no traffic on this connection */
@@ -386,6 +392,7 @@ ENVELOPE
        char            *e_msgboundary; /* MIME-style message part boundary */
        char            *e_origrcpt;    /* original recipient (one only) */
        char            *e_envid;       /* envelope id from MAIL FROM: line */
        char            *e_msgboundary; /* MIME-style message part boundary */
        char            *e_origrcpt;    /* original recipient (one only) */
        char            *e_envid;       /* envelope id from MAIL FROM: line */
+       char            *e_status;      /* DSN status for this message */
        time_t          e_dtime;        /* time of last delivery attempt */
        int             e_ntries;       /* number of delivery attempts */
        dev_t           e_dfdev;        /* df file's device, for crash recov */
        time_t          e_dtime;        /* time of last delivery attempt */
        int             e_ntries;       /* number of delivery attempts */
        dev_t           e_dfdev;        /* df file's device, for crash recov */
@@ -416,6 +423,7 @@ ENVELOPE
 #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 */
 #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 */
+#define EF_IS_MIME     0x0400000       /* really is a MIME message */
 
 EXTERN ENVELOPE        *CurEnv;        /* envelope currently being processed */
 \f/*
 
 EXTERN ENVELOPE        *CurEnv;        /* envelope currently being processed */
 \f/*
@@ -768,6 +776,12 @@ EXTERN int         NoRecipientAction;
 #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 */
 #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 */
+
+
+/* flags to putxline */
+#define PXLF_NOTHINGSPECIAL    0       /* no special mapping */
+#define PXLF_MAPFROM           0x0001  /* map From_ to >From_ */
+#define PXLF_STRIP8BIT         0x0002  /* strip 8th bit *e
 \f/*
 **  Additional definitions
 */
 \f/*
 **  Additional definitions
 */
@@ -820,6 +834,7 @@ 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_RUNASREALUID       0x0008  /* if no ctladdr, run as real uid */
 #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_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 */
@@ -835,6 +850,7 @@ struct prival
 
 #define M87F_OUTER             0       /* outer context */
 #define M87F_NO8BIT            0x0001  /* can't have 8-bit in this section */
 
 #define M87F_OUTER             0       /* outer context */
 #define M87F_NO8BIT            0x0001  /* can't have 8-bit in this section */
+#define M87F_DIGEST            0x0002  /* processing multipart/digest */
 
 
 /*
 
 
 /*
@@ -882,6 +898,7 @@ union bigsockaddr
 
 #define VENDOR_BERKELEY        1       /* Berkeley-native configuration file */
 #define VENDOR_SUN     2       /* Sun-native configuration file */
 
 #define VENDOR_BERKELEY        1       /* Berkeley-native configuration file */
 #define VENDOR_SUN     2       /* Sun-native configuration file */
+#define VENDOR_HP      3       /* Hewlett-Packard specific config syntax */
 
 EXTERN int     VendorCode;     /* vendor-specific operation enhancements */
 \f/*
 
 EXTERN int     VendorCode;     /* vendor-specific operation enhancements */
 \f/*
@@ -944,6 +961,8 @@ EXTERN bool UseErrorsTo;    /* use Errors-To: header (back compat) */
 EXTERN bool    TryNullMXList;  /* if we are the best MX, try host directly */
 EXTERN bool    InChild;        /* true if running in an SMTP subprocess */
 EXTERN bool    DisConnected;   /* running with OutChannel redirected to xf */
 EXTERN bool    TryNullMXList;  /* if we are the best MX, try host directly */
 EXTERN bool    InChild;        /* true if running in an SMTP subprocess */
 EXTERN bool    DisConnected;   /* running with OutChannel redirected to xf */
+EXTERN bool    ColonOkInAddr;  /* single colon legal in address */
+EXTERN bool    NoMXforCanon;   /* don't use MX records when canonifying */
 EXTERN char    SpaceSub;       /* substitution for <lwsp> */
 EXTERN int     PrivacyFlags;   /* privacy flags */
 EXTERN char    *ConfFile;      /* location of configuration file [conf.c] */
 EXTERN char    SpaceSub;       /* substitution for <lwsp> */
 EXTERN int     PrivacyFlags;   /* privacy flags */
 EXTERN char    *ConfFile;      /* location of configuration file [conf.c] */
@@ -964,13 +983,13 @@ 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 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    *HostsFile;     /* path to /etc/hosts file */
 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    *PostMasterCopy;        /* address to get errs cc's */
 EXTERN int     CheckpointInterval;     /* queue file checkpoint interval */
 EXTERN bool    DontPruneRoutes;        /* don't prune source routes */
 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    *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     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 */
@@ -1063,7 +1082,7 @@ extern void               define __P((int, char *, ENVELOPE *));
 extern char            *macvalue __P((int, ENVELOPE *));
 extern char            *macname __P((int));
 extern int             macid __P((char *, char **));
 extern char            *macvalue __P((int, ENVELOPE *));
 extern char            *macname __P((int));
 extern int             macid __P((char *, char **));
-extern char            **prescan __P((char *, int, char[], int, char **));
+extern char            **prescan __P((char *, int, char[], int, char **, char *));
 extern int             rewrite __P((char **, int, int, ENVELOPE *));
 extern char            *fgetfolded __P((char *, int, FILE *));
 extern ADDRESS         *recipient __P((ADDRESS *, ADDRESS **, int, ENVELOPE *));
 extern int             rewrite __P((char **, int, int, ENVELOPE *));
 extern char            *fgetfolded __P((char *, int, FILE *));
 extern ADDRESS         *recipient __P((ADDRESS *, ADDRESS **, int, ENVELOPE *));