1295Seric /* 2*22727Sdist ** Sendmail 3*22727Sdist ** Copyright (c) 1983 Eric P. Allman 4*22727Sdist ** Berkeley, California 5*22727Sdist ** 6*22727Sdist ** Copyright (c) 1983 Regents of the University of California. 7*22727Sdist ** All rights reserved. The Berkeley software License Agreement 8*22727Sdist ** specifies the terms and conditions for redistribution. 9*22727Sdist ** 10*22727Sdist ** @(#)sendmail.h 5.1 (Berkeley) 06/07/85 11*22727Sdist */ 12*22727Sdist 13*22727Sdist /* 143313Seric ** SENDMAIL.H -- Global definitions for sendmail. 15295Seric */ 16295Seric 17295Seric 18295Seric 194371Seric # ifdef _DEFINE 204371Seric # define EXTERN 215194Seric # ifndef lint 22*22727Sdist static char SmailSccsId[] = "@(#)sendmail.h 5.1 06/07/85"; 235194Seric # endif lint 244371Seric # else _DEFINE 254371Seric # define EXTERN extern 264371Seric # endif _DEFINE 27295Seric 284183Seric # include <stdio.h> 294183Seric # include <ctype.h> 307355Seric # include <setjmp.h> 319144Seric # include "conf.h" 321390Seric # include "useful.h" 331390Seric 347674Seric # ifdef LOG 3518575Smiriam # include <sys/syslog.h> 367674Seric # endif LOG 3710679Seric 3810679Seric 3916907Seric # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 4016907Seric 4116907Seric 4210679Seric /* 4310679Seric ** Data structure for bit maps. 4410679Seric ** 4510679Seric ** Each bit in this map can be referenced by an ascii character. 4610679Seric ** This is 128 possible bits, or 12 8-bit bytes. 4710679Seric */ 4810679Seric 4910679Seric #define BITMAPBYTES 16 /* number of bytes in a bit map */ 5010679Seric #define BYTEBITS 8 /* number of bits in a byte */ 5110679Seric 5210679Seric /* internal macros */ 5310679Seric #define _BITWORD(bit) (bit / (BYTEBITS * sizeof (int))) 5410679Seric #define _BITBIT(bit) (1 << (bit % (BYTEBITS * sizeof (int)))) 5510679Seric 5610679Seric typedef int BITMAP[BITMAPBYTES / sizeof (int)]; 5710679Seric 5810679Seric /* test bit number N */ 5910679Seric #define bitnset(bit, map) ((map)[_BITWORD(bit)] & _BITBIT(bit)) 6010679Seric 6110679Seric /* set bit number N */ 6210679Seric #define setbitn(bit, map) (map)[_BITWORD(bit)] |= _BITBIT(bit) 6310679Seric 6410679Seric /* clear bit number N */ 6510679Seric #define clrbitn(bit, map) (map)[_BITWORD(bit)] &= ~_BITBIT(bit) 6610679Seric 6710679Seric /* clear an entire bit map */ 6811053Seric #define clrbitmap(map) bzero((char *) map, BITMAPBYTES) 697799Seric /* 703190Seric ** Address structure. 713190Seric ** Addresses are stored internally in this structure. 723190Seric */ 733190Seric 743190Seric struct address 753190Seric { 763190Seric char *q_paddr; /* the printname for the address */ 773190Seric char *q_user; /* user name */ 783190Seric char *q_host; /* host name */ 794597Seric struct mailer *q_mailer; /* mailer to use */ 804149Seric u_short q_flags; /* status flags, see below */ 814213Seric short q_uid; /* user-id of receiver (if known) */ 824398Seric short q_gid; /* group-id of receiver (if known) */ 834079Seric char *q_home; /* home dir (local mailer only) */ 844995Seric char *q_fullname; /* full name if known */ 854995Seric struct address *q_next; /* chain */ 864995Seric struct address *q_alias; /* address this results from */ 875034Seric struct address *q_tchain; /* temporary use chain */ 884987Seric time_t q_timeout; /* timeout for this address */ 893190Seric }; 903190Seric 913190Seric typedef struct address ADDRESS; 923190Seric 933190Seric # define QDONTSEND 000001 /* don't send to this address */ 944068Seric # define QBADADDR 000002 /* this address is verified bad */ 954403Seric # define QGOODUID 000004 /* the q_uid q_gid fields are good */ 964422Seric # define QPRIMARY 000010 /* set from argv */ 974624Seric # define QQUEUEUP 000020 /* queue for later transmission */ 986902Seric /* 99295Seric ** Mailer definition structure. 100295Seric ** Every mailer known to the system is declared in this 101295Seric ** structure. It defines the pathname of the mailer, some 102295Seric ** flags associated with it, and the argument vector to 1031390Seric ** pass to it. The flags are defined in conf.c 104295Seric ** 1054171Seric ** The argument vector is expanded before actual use. All 1064171Seric ** words except the first are passed through the macro 1074171Seric ** processor. 108295Seric */ 109295Seric 110295Seric struct mailer 111295Seric { 1123190Seric char *m_name; /* symbolic name of this mailer */ 113295Seric char *m_mailer; /* pathname of the mailer to use */ 11410679Seric BITMAP m_flags; /* status flags, see below */ 1154438Seric short m_mno; /* mailer number internally */ 1163049Seric char **m_argv; /* template argument vector */ 1178061Seric short m_s_rwset; /* rewriting set for sender addresses */ 1188061Seric short m_r_rwset; /* rewriting set for recipient addresses */ 11910323Seric char *m_eol; /* end of line string */ 12010679Seric long m_maxsize; /* size limit on message to this mailer */ 121295Seric }; 122295Seric 1234100Seric typedef struct mailer MAILER; 1244100Seric 1255601Seric /* bits for m_flags */ 12616871Seric # define M_CANONICAL 'C' /* make addresses canonical "u@dom" */ 12716871Seric # define M_EXPENSIVE 'e' /* it costs to use this mailer.... */ 12816871Seric # define M_ESCFROM 'E' /* escape From lines to >From */ 12910679Seric # define M_FOPT 'f' /* mailer takes picky -f flag */ 13016871Seric # define M_HST_UPPER 'h' /* preserve host case distinction */ 13116871Seric # define M_INTERNAL 'I' /* SMTP to another sendmail site */ 13216871Seric # define M_LOCAL 'l' /* delivery is to this host */ 13316871Seric # define M_LIMITS 'L' /* must enforce SMTP line limits */ 13416871Seric # define M_MUSER 'm' /* can handle multiple users at once */ 13516871Seric # define M_NHDR 'n' /* don't insert From line */ 13616871Seric # define M_FROMPATH 'p' /* use reverse-path in MAIL FROM: */ 13710679Seric # define M_ROPT 'r' /* mailer takes picky -r flag */ 13817466Seric # define M_SECURE_PORT 'R' /* try to send on a reserved TCP port */ 13916871Seric # define M_STRIPQ 's' /* strip quote chars from user/host */ 14010679Seric # define M_RESTR 'S' /* must be daemon to execute */ 14110679Seric # define M_USR_UPPER 'u' /* preserve user case distinction */ 14210679Seric # define M_UGLYUUCP 'U' /* this wants an ugly UUCP from line */ 14310679Seric # define M_XDOT 'X' /* use hidden-dot algorithm */ 144295Seric 1454597Seric EXTERN MAILER *Mailer[MAXMAILERS+1]; 146295Seric 1474597Seric EXTERN MAILER *LocalMailer; /* ptr to local mailer */ 1484597Seric EXTERN MAILER *ProgMailer; /* ptr to program mailer */ 1496902Seric /* 1502899Seric ** Header structure. 1512899Seric ** This structure is used internally to store header items. 1522899Seric */ 153295Seric 1542899Seric struct header 1552899Seric { 1562899Seric char *h_field; /* the name of the field */ 1572899Seric char *h_value; /* the value of that field */ 1582899Seric struct header *h_link; /* the next header */ 1594149Seric u_short h_flags; /* status bits, see below */ 16010679Seric BITMAP h_mflags; /* m_flags bits needed */ 1612899Seric }; 162295Seric 1632899Seric typedef struct header HDR; 1642899Seric 165295Seric /* 1662899Seric ** Header information structure. 1672899Seric ** Defined in conf.c, this struct declares the header fields 1682899Seric ** that have some magic meaning. 1692899Seric */ 1702899Seric 1712899Seric struct hdrinfo 1722899Seric { 1732899Seric char *hi_field; /* the name of the field */ 1744149Seric u_short hi_flags; /* status bits, see below */ 1752899Seric }; 1762899Seric 1772899Seric extern struct hdrinfo HdrInfo[]; 1782899Seric 1792899Seric /* bits for h_flags and hi_flags */ 1803060Seric # define H_EOH 00001 /* this field terminates header */ 1815918Seric # define H_RCPT 00002 /* contains recipient addresses */ 1822899Seric # define H_DEFAULT 00004 /* if another value is found, drop this */ 18311416Seric # define H_RESENT 00010 /* this address is a "Resent-..." address */ 1843386Seric # define H_CHECK 00020 /* check h_mflags against m_flags */ 1853390Seric # define H_ACHECK 00040 /* ditto, but always (not just default) */ 1864149Seric # define H_FORCE 00100 /* force this field, even if default */ 1878061Seric # define H_TRACE 00200 /* this field contains trace information */ 1887761Seric # define H_FROM 00400 /* this is a from-type field */ 1896902Seric /* 1906902Seric ** Envelope structure. 1916902Seric ** This structure defines the message itself. There is usually 1926902Seric ** only one of these -- for the message that we originally read 1936902Seric ** and which is our primary interest -- but other envelopes can 1946902Seric ** be generated during processing. For example, error messages 1956902Seric ** will have their own envelope. 1966902Seric */ 1972899Seric 1986902Seric struct envelope 1996902Seric { 2006987Seric HDR *e_header; /* head of header list */ 2016987Seric long e_msgpriority; /* adjusted priority of this message */ 2027859Seric time_t e_ctime; /* time message appeared in the queue */ 2036987Seric char *e_to; /* the target person */ 2048061Seric char *e_receiptto; /* return receipt address */ 2056987Seric ADDRESS e_from; /* the person it is from */ 2068180Seric char **e_fromdomain; /* the domain part of the sender */ 2076987Seric ADDRESS *e_sendqueue; /* list of message recipients */ 2087044Seric ADDRESS *e_errorqueue; /* the queue for error responses */ 2096987Seric long e_msgsize; /* size of the message in bytes */ 2106987Seric short e_class; /* msg class (priority, junk, etc.) */ 2119336Seric short e_flags; /* flags, see below */ 2129373Seric short e_hopcount; /* number of times processed */ 2136987Seric int (*e_puthdr)(); /* function to put header of message */ 2146987Seric int (*e_putbody)(); /* function to put body of message */ 2156987Seric struct envelope *e_parent; /* the message this one encloses */ 2169336Seric struct envelope *e_sibling; /* the next envelope of interest */ 2176987Seric char *e_df; /* location of temp file */ 2189541Seric FILE *e_dfp; /* temporary file */ 2197810Seric char *e_id; /* code for this entry in queue */ 2209541Seric FILE *e_xfp; /* transcript file */ 22110102Seric char *e_message; /* error message */ 2226987Seric char *e_macro[128]; /* macro definitions */ 2236902Seric }; 2242899Seric 2256902Seric typedef struct envelope ENVELOPE; 2264624Seric 2279336Seric /* values for e_flags */ 2289336Seric #define EF_OLDSTYLE 000001 /* use spaces (not commas) in hdrs */ 2299336Seric #define EF_INQUEUE 000002 /* this message is fully queued */ 2309336Seric #define EF_TIMEOUT 000004 /* this message is too old */ 2319336Seric #define EF_CLRQUEUE 000010 /* disk copy is no longer needed */ 2329336Seric #define EF_SENDRECEIPT 000020 /* send a return receipt */ 2339336Seric #define EF_FATALERRS 000040 /* fatal errors occured */ 2349336Seric #define EF_KEEPQUEUE 000100 /* keep queue files always */ 2359373Seric #define EF_RESPONSE 000200 /* this is an error or return receipt */ 23611416Seric #define EF_RESENT 000400 /* this message is being forwarded */ 2379336Seric 2386902Seric EXTERN ENVELOPE *CurEnv; /* envelope currently being processed */ 2396902Seric /* 2404624Seric ** Message priorities. 2414633Seric ** Priorities > 0 should be preemptive. 2425034Seric ** 2436902Seric ** CurEnv->e_msgpriority is the number of bytes in the message adjusted 2445034Seric ** by the message priority and the amount of time the message 2455034Seric ** has been sitting around. Each priority point is worth 2465034Seric ** WKPRIFACT bytes of message, and each time we reprocess a 2475034Seric ** message the size gets reduced by WKTIMEFACT. 2486910Seric ** 24912516Seric ** WKTIMEFACT is negative since jobs that fail once have a high 25012516Seric ** probability of failing again. Making it negative tends to force 25112516Seric ** them to the back rather than the front of the queue, where they 25212516Seric ** only clog things. Thanks go to Jay Lepreau at Utah for pointing 25312516Seric ** out the error in my thinking. 25412516Seric ** 2556910Seric ** The "class" is this number, unadjusted by the age or size of 2566910Seric ** this message. Classes with negative representations will have 2576910Seric ** error messages thrown away if they are not local. 2584624Seric */ 2594624Seric 2608249Seric struct priority 2618249Seric { 2628249Seric char *pri_name; /* external name of priority */ 2638249Seric int pri_val; /* internal value for same */ 2648249Seric }; 2654624Seric 2668249Seric EXTERN struct priority Priorities[MAXPRIORITIES]; 2678249Seric EXTERN int NumPriorities; /* pointer into Priorities */ 2688249Seric 2695034Seric # define WKPRIFACT 1800 /* bytes each pri point is worth */ 27012516Seric # define WKTIMEFACT (-600) /* bytes each reprocessing is worth */ 2716902Seric /* 2723153Seric ** Rewrite rules. 2733153Seric */ 2742899Seric 2753153Seric struct rewrite 2763153Seric { 2773153Seric char **r_lhs; /* pattern match */ 2783153Seric char **r_rhs; /* substitution value */ 2793153Seric struct rewrite *r_next;/* next in chain */ 2803153Seric }; 2812899Seric 2828057Seric EXTERN struct rewrite *RewriteRules[MAXRWSETS]; 2833153Seric 2848057Seric /* 2858057Seric ** Special characters in rewriting rules. 2868057Seric ** These are used internally only. 2878057Seric ** The COND* rules are actually used in macros rather than in 2888057Seric ** rewriting rules, but are given here because they 2898057Seric ** cannot conflict. 2908057Seric */ 2913153Seric 2928057Seric /* left hand side items */ 2938057Seric # define MATCHZANY '\020' /* match zero or more tokens */ 2948057Seric # define MATCHANY '\021' /* match one or more tokens */ 2958057Seric # define MATCHONE '\022' /* match exactly one token */ 2968057Seric # define MATCHCLASS '\023' /* match one token in a class */ 29716908Seric # define MATCHNCLASS '\024' /* match anything not in class */ 29816908Seric # define MATCHREPL '\025' /* replacement on RHS for above */ 2998057Seric 3008057Seric /* right hand side items */ 30116908Seric # define CANONNET '\026' /* canonical net, next token */ 30216908Seric # define CANONHOST '\027' /* canonical host, next token */ 30316908Seric # define CANONUSER '\030' /* canonical user, next N tokens */ 30416908Seric # define CALLSUBR '\031' /* call another rewriting set */ 3053153Seric 3068057Seric /* conditionals in macros */ 30716908Seric # define CONDIF '\032' /* conditional if-then */ 30816908Seric # define CONDELSE '\033' /* conditional else */ 30916908Seric # define CONDFI '\034' /* conditional fi */ 31016151Seric 31116905Seric /* bracket characters for host name lookup */ 31216908Seric # define HOSTBEGIN '\035' /* hostname lookup begin */ 31316908Seric # define HOSTEND '\036' /* hostname lookup end */ 31416905Seric 31516151Seric /* \001 is also reserved as the macro expansion character */ 3166902Seric /* 3174056Seric ** Symbol table definitions 3184056Seric */ 3193153Seric 3204056Seric struct symtab 3214056Seric { 3224056Seric char *s_name; /* name to be entered */ 3234100Seric char s_type; /* general type (see below) */ 3244056Seric struct symtab *s_next; /* pointer to next in chain */ 3254100Seric union 3264100Seric { 32710679Seric BITMAP sv_class; /* bit-map of word classes */ 3284100Seric ADDRESS *sv_addr; /* pointer to address header */ 3294100Seric MAILER *sv_mailer; /* pointer to mailer */ 3304100Seric char *sv_alias; /* alias */ 3314100Seric } s_value; 3324056Seric }; 3334056Seric 3344056Seric typedef struct symtab STAB; 3354056Seric 3364100Seric /* symbol types */ 3374100Seric # define ST_UNDEF 0 /* undefined type */ 3384100Seric # define ST_CLASS 1 /* class map */ 3394100Seric # define ST_ADDRESS 2 /* an address in parsed format */ 3404100Seric # define ST_MAILER 3 /* a mailer header */ 3414100Seric # define ST_ALIAS 4 /* an alias */ 3424100Seric 3434100Seric # define s_class s_value.sv_class 3445976Seric # define s_address s_value.sv_addr 3454100Seric # define s_mailer s_value.sv_mailer 3464100Seric # define s_alias s_value.sv_alias 3474100Seric 3484056Seric extern STAB *stab(); 3494056Seric 3504056Seric /* opcodes to stab */ 3514056Seric # define ST_FIND 0 /* find entry */ 3524056Seric # define ST_ENTER 1 /* enter if not there */ 3536902Seric /* 3547684Seric ** STRUCT EVENT -- event queue. 3557684Seric ** 3567684Seric ** Maintained in sorted order. 3577931Seric ** 3587931Seric ** We store the pid of the process that set this event to insure 3597931Seric ** that when we fork we will not take events intended for the parent. 3607684Seric */ 3617684Seric 3627684Seric struct event 3637684Seric { 3647684Seric time_t ev_time; /* time of the function call */ 3657684Seric int (*ev_func)(); /* function to call */ 3667684Seric int ev_arg; /* argument to ev_func */ 3677931Seric int ev_pid; /* pid that set this event */ 3687684Seric struct event *ev_link; /* link to next item */ 3697684Seric }; 3707684Seric 3717684Seric typedef struct event EVENT; 3727684Seric 3737684Seric EXTERN EVENT *EventQueue; /* head of event queue */ 3747684Seric /* 3759373Seric ** Operation, send, and error modes 3769278Seric ** 3779278Seric ** The operation mode describes the basic operation of sendmail. 3789278Seric ** This can be set from the command line, and is "send mail" by 3799278Seric ** default. 3809278Seric ** 3819278Seric ** The send mode tells how to send mail. It can be set in the 3829278Seric ** configuration file. It's setting determines how quickly the 3839278Seric ** mail will be delivered versus the load on your system. If the 3849278Seric ** -v (verbose) flag is given, it will be forced to SM_DELIVER 3859278Seric ** mode. 3869278Seric ** 3879373Seric ** The error mode tells how to return errors. 3886997Seric */ 3896997Seric 3909278Seric EXTERN char OpMode; /* operation mode, see below */ 3916997Seric 3929278Seric #define MD_DELIVER 'm' /* be a mail sender */ 3939278Seric #define MD_ARPAFTP 'a' /* old-style arpanet protocols */ 3949278Seric #define MD_SMTP 's' /* run SMTP on standard input */ 3956997Seric #define MD_DAEMON 'd' /* run as a daemon */ 3966997Seric #define MD_VERIFY 'v' /* verify: don't collect or deliver */ 3978334Seric #define MD_TEST 't' /* test mode: resolve addrs only */ 3989144Seric #define MD_INITALIAS 'i' /* initialize alias database */ 3999144Seric #define MD_PRINT 'p' /* print the queue */ 4009144Seric #define MD_FREEZE 'z' /* freeze the configuration file */ 4016997Seric 4029278Seric 4039278Seric EXTERN char SendMode; /* send mode, see below */ 4049278Seric 4059278Seric #define SM_DELIVER 'i' /* interactive delivery */ 4069278Seric #define SM_QUICKD 'j' /* deliver w/o queueing */ 4079278Seric #define SM_FORK 'b' /* deliver in background */ 4089278Seric #define SM_QUEUE 'q' /* queue, don't deliver */ 4099278Seric #define SM_VERIFY 'v' /* verify only (used internally) */ 4109373Seric 41114871Seric /* used only as a parameter to sendall */ 41214871Seric #define SM_DEFAULT '\0' /* unspecified, use SendMode */ 4139373Seric 41414871Seric 4159373Seric EXTERN char ErrorMode; /* error mode, see below */ 4169373Seric 4179373Seric #define EM_PRINT 'p' /* print errors */ 4189373Seric #define EM_MAIL 'm' /* mail back errors */ 4199373Seric #define EM_WRITE 'w' /* write back errors */ 4209373Seric #define EM_BERKNET 'e' /* special berknet processing */ 4219373Seric #define EM_QUIET 'q' /* don't print messages (stat only) */ 4226997Seric /* 423295Seric ** Global variables. 424295Seric */ 425295Seric 4264371Seric EXTERN bool FromFlag; /* if set, "From" person is explicit */ 4274371Seric EXTERN bool NoAlias; /* if set, don't do any aliasing */ 4284371Seric EXTERN bool ForceMail; /* if set, mail even if already got a copy */ 4294371Seric EXTERN bool MeToo; /* send to the sender also */ 4304371Seric EXTERN bool IgnrDot; /* don't let dot end messages */ 4314371Seric EXTERN bool SaveFrom; /* save leading "From" lines */ 4324371Seric EXTERN bool Verbose; /* set if blow-by-blow desired */ 4334371Seric EXTERN bool GrabTo; /* if set, get recipients from msg */ 4344371Seric EXTERN bool NoReturn; /* don't return letter to sender */ 4354553Seric EXTERN bool SuprErrs; /* set if we are suppressing errors */ 4366049Seric EXTERN bool QueueRun; /* currently running message from the queue */ 4374711Seric EXTERN bool HoldErrs; /* only output errors to transcript */ 4385904Seric EXTERN bool NoConnect; /* don't connect to non-local mailers */ 4398268Seric EXTERN bool SuperSafe; /* be extra careful, even if expensive */ 4409144Seric EXTERN bool AutoRebuild; /* auto-rebuild the alias database as needed */ 44117465Seric EXTERN int SafeAlias; /* minutes to wait until @:@ in alias file */ 4428268Seric EXTERN time_t TimeOut; /* time until timeout */ 4434553Seric EXTERN FILE *InChannel; /* input connection */ 4444553Seric EXTERN FILE *OutChannel; /* output connection */ 4454537Seric EXTERN int RealUid; /* when Daemon, real uid of caller */ 4464537Seric EXTERN int RealGid; /* when Daemon, real gid of caller */ 4478268Seric EXTERN int DefUid; /* default uid to run as */ 4488268Seric EXTERN int DefGid; /* default gid to run as */ 4494371Seric EXTERN int OldUmask; /* umask when sendmail starts up */ 4506049Seric EXTERN int Errors; /* set if errors (local to single pass) */ 4514371Seric EXTERN int ExitStat; /* exit status code */ 4524553Seric EXTERN int AliasLevel; /* depth of aliasing */ 4537282Seric EXTERN int MotherPid; /* proc id of parent process */ 4548057Seric EXTERN int LineNumber; /* line number in current input */ 45516139Seric EXTERN time_t ReadTimeout; /* timeout on reads */ 4568268Seric EXTERN int LogLevel; /* level of logging to perform */ 4579045Seric EXTERN int FileMode; /* mode on files */ 4584624Seric EXTERN time_t QueueIntvl; /* intervals between running the queue */ 4594553Seric EXTERN char *HostName; /* name of this host for SMTP messages */ 4608268Seric EXTERN char *AliasFile; /* location of alias file */ 4618268Seric EXTERN char *HelpFile; /* location of SMTP help file */ 4628268Seric EXTERN char *StatFile; /* location of statistics summary */ 4638268Seric EXTERN char *QueueDir; /* location of queue directory */ 4649373Seric EXTERN char *FileName; /* name to print on error messages */ 4658929Seric EXTERN char *TrustedUsers[MAXTRUST+1]; /* list of trusted users */ 4668268Seric EXTERN jmp_buf TopFrame; /* branch-to-top-of-loop-on-error frame */ 4678268Seric EXTERN bool QuickAbort; /* .... but only if we want a quick abort */ 4687859Seric extern char *ConfFile; /* location of configuration file [conf.c] */ 4699065Seric extern char *FreezeFile; /* location of frozen memory image [conf.c] */ 4707859Seric extern char Arpa_Info[]; /* the reply code for Arpanet info [conf.c] */ 4719041Seric extern char SpaceSub; /* substitution for <lwsp> [conf.c] */ 4727674Seric /* 4737674Seric ** Trace information 4747674Seric */ 475295Seric 4767674Seric /* trace vector and macros for debugging flags */ 4777674Seric EXTERN u_char tTdvect[100]; 4787674Seric # define tTd(flag, level) (tTdvect[flag] >= level) 4797674Seric # define tTdlevel(flag) (tTdvect[flag]) 4807674Seric /* 4817674Seric ** Miscellaneous information. 4827674Seric */ 483295Seric 484295Seric # include <sysexits.h> 485295Seric 48610213Seric 48710213Seric /* 48810213Seric ** Some in-line functions 48910213Seric */ 49010213Seric 49110213Seric /* set exit status */ 49211426Seric #define setstat(s) { \ 49311426Seric if (ExitStat == EX_OK || ExitStat == EX_TEMPFAIL) \ 49411426Seric ExitStat = s; \ 49511426Seric } 4964085Seric 49710213Seric /* make a copy of a string */ 49811426Seric #define newstr(s) strcpy(xalloc(strlen(s) + 1), s) 4994085Seric 50010213Seric 50110213Seric /* 50210213Seric ** Declarations of useful functions 50310213Seric */ 50410213Seric 5059883Seric extern ADDRESS *parseaddr(); 5064085Seric extern char *xalloc(); 5074085Seric extern bool sameaddr(); 5086889Seric extern FILE *dfopen(); 5097684Seric extern EVENT *setevent(); 5107684Seric extern char *sfgets(); 5117810Seric extern char *queuename(); 5127884Seric extern time_t curtime(); 513