1 /* 2 ** DLVRMAIL.H -- Global definitions for delivermail. 3 ** 4 ** Most of these are actually allocated in globals.c 5 ** 6 ** @(#)sendmail.h 2.2 11/21/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 # define M_FHDR 0200 /* force good From line */ 59 60 extern struct mailer Mailer[]; 61 62 63 /* 64 ** Address structure. 65 ** Addresses are stored internally in this structure. 66 */ 67 68 struct address 69 { 70 char *q_paddr; /* the printname for the address */ 71 char *q_user; /* user name */ 72 char *q_host; /* host name */ 73 struct mailer *q_mailer; /* mailer to use */ 74 struct address *q_next; /* chain */ 75 struct address *q_prev; /* back pointer */ 76 }; 77 78 typedef struct address addrq; 79 80 /* some other primitives */ 81 # define nxtinq(q) ((q)->q_next) 82 # define clearq(q) (q)->q_next = (q)->q_prev = NULL 83 84 extern addrq SendQ; /* queue of people to send to */ 85 extern addrq AliasQ; /* queue of people that are aliases */ 86 87 88 /* 89 ** Parse structure. 90 ** This table drives the parser which determines the network 91 ** to send the mail to. 92 */ 93 94 struct parsetab 95 { 96 char p_char; /* trigger character */ 97 char p_mailer; /* the index of the mailer to call */ 98 short p_flags; /* see below */ 99 char *p_arg; /* extra info needed for some flags */ 100 }; 101 102 # define P_MAP 0001 /* map p_char -> p_arg[0] */ 103 # define P_HLAST 0002 /* host is last, & right associative */ 104 # define P_ONE 0004 /* can only be one p_char in addr */ 105 # define P_MOVE 0010 /* send untouched to host p_arg */ 106 # define P_USR_UPPER 0020 /* don't map UPPER->lower in user names */ 107 # define P_HST_UPPER 0040 /* don't map UPPER->lower in host names */ 108 109 110 111 112 /* 113 ** Global variables. 114 */ 115 116 extern bool ArpaFmt; /* if set, message is in arpanet fmt */ 117 extern bool FromFlag; /* if set, "From" person is explicit */ 118 extern bool Debug; /* if set, debugging info */ 119 extern bool MailBack; /* mail back response on error */ 120 extern bool BerkNet; /* called from BerkNet */ 121 extern bool WriteBack; /* write back response on error */ 122 extern bool NoAlias; /* if set, don't do any aliasing */ 123 extern bool ForceMail; /* if set, mail even if already got a copy */ 124 extern bool MeToo; /* send to the sender also */ 125 extern bool UseMsgId; /* put msg-id's in all msgs [conf.c] */ 126 extern bool IgnrDot; /* don't let dot end messages */ 127 extern bool SaveFrom; /* save leading "From" lines */ 128 extern int Errors; /* set if errors */ 129 extern int ExitStat; /* exit status code */ 130 extern char InFileName[]; /* input file name */ 131 extern char Transcript[]; /* the transcript file name */ 132 extern char MsgId[]; /* the message id for this message */ 133 extern addrq From; /* the person it is from */ 134 extern char *To; /* the target person */ 135 extern int HopCount; /* hop count */ 136 137 138 # include <sysexits.h> 139 140 # define flagset(bits, word) ((bits) & (word)) 141 # define setstat(s) { if (ExitStat == EX_OK) ExitStat = s; } 142