|
|
1.1 ! root 1: /* ! 2: ** DLVRMAIL.H -- Global definitions for delivermail. ! 3: ** ! 4: ** Most of these are actually allocated in globals.c ! 5: ** ! 6: ** @(#)dlvrmail.h 1.6 10/18/80 ! 7: */ ! 8: ! 9: ! 10: ! 11: ! 12: # include "useful.h" ! 13: ! 14: /* ! 15: ** Manifest constants. ! 16: */ ! 17: ! 18: # define MAXLINE 256 /* maximum line length */ ! 19: # define MAXNAME 128 /* maximum length of a name */ ! 20: # define MAXFIELD 2500 /* maximum total length of a header field */ ! 21: # define MAXPV 15 /* maximum # of parms to mailers */ ! 22: # define MAXHOP 30 /* maximum value of HopCount */ ! 23: # define ALIASFILE "/usr/lib/aliases" /* location of alias file */ ! 24: ! 25: ! 26: ! 27: ! 28: ! 29: /* ! 30: ** Mailer definition structure. ! 31: ** Every mailer known to the system is declared in this ! 32: ** structure. It defines the pathname of the mailer, some ! 33: ** flags associated with it, and the argument vector to ! 34: ** pass to it. The flags are defined in conf.c ! 35: ** ! 36: ** The argument vector is expanded before actual use. Every- ! 37: ** thing is passed through except for things starting with "$". ! 38: ** "$x" defines some interpolation, as described in conf.c ! 39: ** "$x" where x is unknown expands to "x", so use "$$" to get "$". ! 40: */ ! 41: ! 42: struct mailer ! 43: { ! 44: char *m_mailer; /* pathname of the mailer to use */ ! 45: short m_flags; /* status flags, see below */ ! 46: short m_badstat; /* the status code to use on unknown error */ ! 47: char **m_local; /* list of local names for this host */ ! 48: char *m_argv[MAXPV]; /* template argument vector */ ! 49: }; ! 50: ! 51: # define M_FOPT 0001 /* mailer takes picky -f flag */ ! 52: # define M_ROPT 0002 /* mailer takes picky -r flag */ ! 53: # define M_QUIET 0004 /* don't print error on bad status */ ! 54: # define M_RESTR 0010 /* must be daemon to execute */ ! 55: # define M_HDR 0020 /* insert From line */ ! 56: # define M_NOHOST 0040 /* ignore host in comparisons */ ! 57: # define M_STRIPQ 0100 /* strip quote characters from user/host */ ! 58: ! 59: extern struct mailer Mailer[]; ! 60: ! 61: ! 62: /* ! 63: ** Address structure. ! 64: ** Addresses are stored internally in this structure. ! 65: */ ! 66: ! 67: struct address ! 68: { ! 69: char *q_paddr; /* the printname for the address */ ! 70: char *q_user; /* user name */ ! 71: char *q_host; /* host name */ ! 72: struct mailer *q_mailer; /* mailer to use */ ! 73: struct address *q_next; /* chain */ ! 74: struct address *q_prev; /* back pointer */ ! 75: }; ! 76: ! 77: typedef struct address addrq; ! 78: ! 79: /* some other primitives */ ! 80: # define nxtinq(q) ((q)->q_next) ! 81: # define clearq(q) (q)->q_next = (q)->q_prev = NULL ! 82: ! 83: extern addrq SendQ; /* queue of people to send to */ ! 84: extern addrq AliasQ; /* queue of people that are aliases */ ! 85: ! 86: ! 87: /* ! 88: ** Parse structure. ! 89: ** This table drives the parser which determines the network ! 90: ** to send the mail to. ! 91: */ ! 92: ! 93: struct parsetab ! 94: { ! 95: char p_char; /* trigger character */ ! 96: char p_mailer; /* the index of the mailer to call */ ! 97: short p_flags; /* see below */ ! 98: char *p_arg; /* extra info needed for some flags */ ! 99: }; ! 100: ! 101: # define P_MAP 0001 /* map p_char -> p_arg[0] */ ! 102: # define P_HLAST 0002 /* host is last, & right associative */ ! 103: # define P_ONE 0004 /* can only be one p_char in addr */ ! 104: # define P_MOVE 0010 /* send untouched to host p_arg */ ! 105: # define P_USR_UPPER 0020 /* don't map UPPER->lower in user names */ ! 106: # define P_HST_UPPER 0040 /* don't map UPPER->lower in host names */ ! 107: ! 108: ! 109: ! 110: ! 111: /* ! 112: ** Global variables. ! 113: */ ! 114: ! 115: extern bool ArpaFmt; /* if set, message is in arpanet fmt */ ! 116: extern bool FromFlag; /* if set, "From" person is explicit */ ! 117: extern bool Debug; /* if set, debugging info */ ! 118: extern bool MailBack; /* mail back response on error */ ! 119: extern bool BerkNet; /* called from BerkNet */ ! 120: extern bool WriteBack; /* write back response on error */ ! 121: extern bool NoAlias; /* if set, don't do any aliasing */ ! 122: extern bool ForceMail; /* if set, mail even if already got a copy */ ! 123: extern bool MeToo; /* send to the sender also */ ! 124: extern bool UseMsgId; /* put msg-id's in all msgs [conf.c] */ ! 125: extern bool IgnrDot; /* don't let dot end messages */ ! 126: extern bool SaveFrom; /* save leading "From" lines */ ! 127: extern int Errors; /* set if errors */ ! 128: extern int ExitStat; /* exit status code */ ! 129: extern char InFileName[]; /* input file name */ ! 130: extern char Transcript[]; /* the transcript file name */ ! 131: extern char MsgId[]; /* the message id for this message */ ! 132: extern addrq From; /* the person it is from */ ! 133: extern char *To; /* the target person */ ! 134: extern int HopCount; /* hop count */ ! 135: ! 136: ! 137: # include <sysexits.h> ! 138: ! 139: # define flagset(bits, word) ((bits) & (word)) ! 140: # define setstat(s) { if (ExitStat == EX_OK) ExitStat = s; }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.