4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / usr.sbin / sendmail / src / sendmail.h
index 129805b..ee8f4d4 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)sendmail.h  6.57 (Berkeley) %G%
+ *     @(#)sendmail.h  6.73 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -15,7 +15,7 @@
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 6.57            %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 6.73            %G%";
 # endif
 # else /*  _DEFINE */
 # define EXTERN extern
 # endif
 # else /*  _DEFINE */
 # define EXTERN extern
@@ -281,7 +281,7 @@ ENVELOPE
        short           e_errormode;    /* error return mode */
        int             (*e_puthdr)__P((FILE *, MAILER *, ENVELOPE *));
                                        /* function to put header of message */
        short           e_errormode;    /* error return mode */
        int             (*e_puthdr)__P((FILE *, MAILER *, ENVELOPE *));
                                        /* function to put header of message */
-       int             (*e_putbody)__P((FILE *, MAILER *, ENVELOPE *));
+       int             (*e_putbody)__P((FILE *, MAILER *, ENVELOPE *, char *));
                                        /* function to put body of message */
        struct envelope *e_parent;      /* the message this one encloses */
        struct envelope *e_sibling;     /* the next envelope of interest */
                                        /* function to put body of message */
        struct envelope *e_parent;      /* the message this one encloses */
        struct envelope *e_sibling;     /* the next envelope of interest */
@@ -294,6 +294,7 @@ ENVELOPE
        FILE            *e_qfp;         /* queue control file */
        char            *e_message;     /* error message */
        char            *e_statmsg;     /* stat msg (changes per delivery) */
        FILE            *e_qfp;         /* queue control file */
        char            *e_message;     /* error message */
        char            *e_statmsg;     /* stat msg (changes per delivery) */
+       char            *e_msgboundary; /* MIME-style message part boundary */
        char            *e_macro[128];  /* macro definitions */
 };
 
        char            *e_macro[128];  /* macro definitions */
 };
 
@@ -407,9 +408,6 @@ struct metamac
        char    metaname;       /* external code (after $) */
        char    metaval;        /* internal code (as above) */
 };
        char    metaname;       /* external code (after $) */
        char    metaval;        /* internal code (as above) */
 };
-
-
-#define ALIASCLASS     struct _aliasclass
 \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.
@@ -492,21 +490,27 @@ NAMECANON
 MAP
 {
        MAPCLASS        *map_class;     /* the class of this map */
 MAP
 {
        MAPCLASS        *map_class;     /* the class of this map */
-       int             map_flags;      /* flags, see below */
+       char            *map_mname;     /* name of this map */
+       int             map_mflags;     /* flags, see below */
        char            *map_file;      /* the (nominal) filename */
        char            *map_file;      /* the (nominal) filename */
-       void            *map_db;        /* the open database ptr */
+       void            *map_db1;       /* the open database ptr */
+       void            *map_db2;       /* an "extra" database pointer */
        char            *map_app;       /* to append to successful matches */
        char            *map_domain;    /* the (nominal) NIS domain */
        char            *map_rebuild;   /* program to run to do auto-rebuild */
        char            *map_app;       /* to append to successful matches */
        char            *map_domain;    /* the (nominal) NIS domain */
        char            *map_rebuild;   /* program to run to do auto-rebuild */
-       char            **map_deplist;  /* dependency list */
 };
 
 /* bit values for map_flags */
 };
 
 /* bit values for map_flags */
-# define MF_VALID      00001           /* this entry is valid */
-# define MF_INCLNULL   00002           /* include null byte in key */
-# define MF_OPTIONAL   00004           /* don't complain if map not found */
-# define MF_NOFOLDCASE 00010           /* don't fold case in keys */
-# define MF_MATCHONLY  00020           /* don't use the map value */
+# 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_IMPL_HASH  0x1000          /* implicit: underlying hash database */
+# define MF_IMPL_NDBM  0x2000          /* implicit: underlying NDBM database */
 
 
 /*
 
 
 /*
@@ -515,11 +519,25 @@ MAP
 
 MAPCLASS
 {
 
 MAPCLASS
 {
-       bool    (*map_init)__P((MAP *, char *, char *));
-                                       /* initialization function */
-       char    *(*map_lookup)__P((MAP *, char *, int, char **, int *));
+       char    *map_cname;             /* name of this map class */
+       char    *map_ext;               /* extension for database file */
+       short   map_cflags;             /* flag bits, see below */
+       bool    (*map_parse)__P((MAP *, char *));
+                                       /* argument parsing function */
+       char    *(*map_lookup)__P((MAP *, char *, char **, int *));
                                        /* lookup function */
                                        /* lookup function */
+       void    (*map_store)__P((MAP *, char *, char *));
+                                       /* store function */
+       bool    (*map_open)__P((MAP *, int));
+                                       /* open function */
+       void    (*map_close)__P((MAP *));
+                                       /* close function */
 };
 };
+
+/* bit values for map_cflags */
+#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 */
 \f/*
 **  Symbol table definitions
 */
 \f/*
 **  Symbol table definitions
 */
@@ -540,7 +558,6 @@ struct symtab
                char            *sv_hostsig;    /* host signature */
                MCI             sv_mci;         /* mailer connection info */
                NAMECANON       sv_namecanon;   /* canonical name cache */
                char            *sv_hostsig;    /* host signature */
                MCI             sv_mci;         /* mailer connection info */
                NAMECANON       sv_namecanon;   /* canonical name cache */
-               ALIASCLASS      *sv_aliasclass; /* alias class (type) */
        }       s_value;
 };
 
        }       s_value;
 };
 
@@ -556,7 +573,6 @@ typedef struct symtab       STAB;
 # define ST_MAP                6       /* mapping function */
 # define ST_HOSTSIG    7       /* host signature */
 # define ST_NAMECANON  8       /* cached canonical name */
 # define ST_MAP                6       /* mapping function */
 # define ST_HOSTSIG    7       /* host signature */
 # define ST_NAMECANON  8       /* cached canonical name */
-# define ST_ALIASCLASS 9       /* alias class */
 # 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
@@ -565,7 +581,8 @@ typedef struct symtab       STAB;
 # define s_alias       s_value.sv_alias
 # define s_mci         s_value.sv_mci
 
 # define s_alias       s_value.sv_alias
 # define s_mci         s_value.sv_mci
 
-extern STAB    *stab();
+extern STAB            *stab __P((char *, int, int));
+extern void            stabapply __P((void (*)(STAB *, int), int));
 
 /* opcodes to stab */
 # define ST_FIND       0       /* find entry */
 
 /* opcodes to stab */
 # define ST_FIND       0       /* find entry */
@@ -721,8 +738,9 @@ EXTERN bool SuperSafe;      /* be extra careful, even if expensive */
 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    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    UseNameServer;  /* use internet domain name server */
 EXTERN bool    UseNameServer;  /* use internet domain name server */
-EXTERN bool    EightBit;       /* try to preserve 8-bit data */
+EXTERN bool    SevenBit;       /* force 7-bit data */
 EXTERN int     SafeAlias;      /* minutes to wait until @:@ in alias file */
 EXTERN FILE    *InChannel;     /* input connection */
 EXTERN FILE    *OutChannel;    /* output connection */
 EXTERN int     SafeAlias;      /* minutes to wait until @:@ in alias file */
 EXTERN FILE    *InChannel;     /* input connection */
 EXTERN FILE    *OutChannel;    /* output connection */
@@ -756,32 +774,34 @@ EXTERN char       *CurHostName;   /* current host we are dealing with */
 EXTERN jmp_buf TopFrame;       /* branch-to-top-of-loop-on-error frame */
 EXTERN bool    QuickAbort;     /*  .... but only if we want a quick abort */
 EXTERN bool    LogUsrErrs;     /* syslog user errors (e.g., SMTP RCPT cmd) */
 EXTERN jmp_buf TopFrame;       /* branch-to-top-of-loop-on-error frame */
 EXTERN bool    QuickAbort;     /*  .... but only if we want a quick abort */
 EXTERN bool    LogUsrErrs;     /* syslog user errors (e.g., SMTP RCPT cmd) */
+EXTERN bool    SendMIMEErrors; /* send error messages in MIME format */
+EXTERN bool    MatchGecos;     /* look for user names in gecos field */
+EXTERN bool    UseErrorsTo;    /* use Errors-To: header (back compat) */
+EXTERN char    SpaceSub;       /* substitution for <lwsp> */
 EXTERN int     PrivacyFlags;   /* privacy flags */
 extern char    *ConfFile;      /* location of configuration file [conf.c] */
 extern char    *FreezeFile;    /* location of frozen memory image [conf.c] */
 extern char    *PidFile;       /* location of proc id file [conf.c] */
 extern ADDRESS NullAddress;    /* a null (template) address [main.c] */
 EXTERN int     PrivacyFlags;   /* privacy flags */
 extern char    *ConfFile;      /* location of configuration file [conf.c] */
 extern char    *FreezeFile;    /* location of frozen memory image [conf.c] */
 extern char    *PidFile;       /* location of proc id file [conf.c] */
 extern ADDRESS NullAddress;    /* a null (template) address [main.c] */
-EXTERN char    SpaceSub;       /* substitution for <lwsp> */
 EXTERN long    WkClassFact;    /* multiplier for message class -> priority */
 EXTERN long    WkRecipFact;    /* multiplier for # of recipients -> priority */
 EXTERN long    WkTimeFact;     /* priority offset each time this job is run */
 EXTERN long    WkClassFact;    /* multiplier for message class -> priority */
 EXTERN long    WkRecipFact;    /* multiplier for # of recipients -> priority */
 EXTERN long    WkTimeFact;     /* priority offset each time this job is run */
+EXTERN char    *UdbSpec;       /* user database source spec */
+EXTERN int     MaxHopCount;    /* max # of hops until bounce */
+EXTERN int     ConfigLevel;    /* config file level */
+EXTERN char    *TimeZoneSpec;  /* override time zone specification */
+EXTERN char    *ForwardPath;   /* path to search for .forward files */
+EXTERN long    MinBlocksFree;  /* min # of blocks free on queue fs */
+EXTERN char    *FallBackMX;    /* fall back MX host */
+EXTERN long    MaxMessageSize; /* advertised max size we will accept */
 EXTERN char    *PostMasterCopy;        /* address to get errs cc's */
 EXTERN int     CheckpointInterval;     /* queue file checkpoint interval */
 EXTERN char    *PostMasterCopy;        /* address to get errs cc's */
 EXTERN int     CheckpointInterval;     /* queue file checkpoint interval */
-EXTERN char    *UdbSpec;               /* user database source spec */
-EXTERN int     MaxHopCount;            /* max # of hops until bounce */
-EXTERN int     ConfigLevel;            /* config file level */
-EXTERN char    *TimeZoneSpec;          /* override time zone specification */
-EXTERN bool    MatchGecos;             /* look for user names in gecos field */
 EXTERN bool    DontPruneRoutes;        /* don't prune source routes */
 EXTERN int     MaxMciCache;            /* maximum entries in MCI cache */
 EXTERN time_t  MciCacheTimeout;        /* maximum idle time on connections */
 EXTERN bool    DontPruneRoutes;        /* don't prune source routes */
 EXTERN int     MaxMciCache;            /* maximum entries in MCI cache */
 EXTERN time_t  MciCacheTimeout;        /* maximum idle time on connections */
-EXTERN char    *ForwardPath;           /* path to search for .forward files */
-EXTERN long    MinBlocksFree;          /* min # of blocks free on queue fs */
 EXTERN char    *QueueLimitRecipient;   /* limit queue runs to this recipient */
 EXTERN char    *QueueLimitSender;      /* limit queue runs to this sender */
 EXTERN char    *QueueLimitId;          /* limit queue runs to this id */
 EXTERN char    *QueueLimitRecipient;   /* limit queue runs to this recipient */
 EXTERN char    *QueueLimitSender;      /* limit queue runs to this sender */
 EXTERN char    *QueueLimitId;          /* limit queue runs to this id */
-EXTERN char    *FallBackMX;            /* fall back MX host */
-EXTERN long    MaxMessageSize;         /* advertised max size we will accept */
 
 
 /*
 
 
 /*
@@ -844,30 +864,51 @@ EXTERN u_char     tTdvect[100];
 **  Declarations of useful functions
 */
 
 **  Declarations of useful functions
 */
 
-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 *, char *));
-extern EVENT   *setevent __P((time_t, int(*)(), int));
-extern char    *sfgets __P((char *, int, FILE *, time_t));
-extern char    *queuename __P((ENVELOPE *, int));
-extern time_t  curtime __P(());
-extern bool    transienterror __P((int));
-extern char    *errstring __P((int));
+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 EVENT           *setevent __P((time_t, int(*)(), 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            define __P((int, char *, ENVELOPE *));
+extern char            *macvalue __P((int, ENVELOPE *));
+extern char            **prescan __P((char *, int, char[], char **));
+extern char            *fgetfolded __P((char *, int, FILE *));
+extern ADDRESS         *recipient __P((ADDRESS *, ADDRESS **, ENVELOPE *));
+extern ENVELOPE                *newenvelope __P((ENVELOPE *, ENVELOPE *));
+extern void            dropenvelope __P((ENVELOPE *));
+extern void            clearenvelope __P((ENVELOPE *, int));
+extern char            *username __P(());
+extern MCI             *mci_get __P((char *, MAILER *));
+extern char            *pintvl __P((time_t, int));
+extern char            *map_rewrite __P((MAP *, char *, int, char **));
+extern ADDRESS         *getctladdr __P((ADDRESS *));
+extern char            *anynet_ntoa __P((SOCKADDR *));
+extern char            *remotename __P((char *, MAILER *, int, int *, ENVELOPE *));
+extern bool            shouldqueue __P((long, time_t));
+extern bool            lockfile __P((int, char *, int));
+extern char            *hostsignature __P((MAILER *, char *, ENVELOPE *));
+extern void            openxscript __P((ENVELOPE *));
+extern void            closexscript __P((ENVELOPE *));
 
 /* ellipsis is a different case though */
 #ifdef __STDC__
 
 /* ellipsis is a different case though */
 #ifdef __STDC__
-extern void    auth_warning(ENVELOPE *, char *, ...);
-extern void    syserr(char *, ...);
-extern void    usrerr(char *, ...);
-extern void    message(char *, ...);
-extern void    nmessage(char *, ...);
+extern void            auth_warning(ENVELOPE *, const char *, ...);
+extern void            syserr(const char *, ...);
+extern void            usrerr(const char *, ...);
+extern void            message(const char *, ...);
+extern void            nmessage(const char *, ...);
 #else
 #else
-extern void    auth_warning();
-extern void    syserr();
-extern void    usrerr();
-extern void    message();
-extern void    nmessage();
+extern void            auth_warning();
+extern void            syserr();
+extern void            usrerr();
+extern void            message();
+extern void            nmessage();
 #endif
 
 /*
 #endif
 
 /*