1295Seric /*
23313Seric **  SENDMAIL.H -- Global definitions for sendmail.
3295Seric */
4295Seric 
5295Seric 
6295Seric 
74371Seric # ifdef _DEFINE
84371Seric # define EXTERN
95194Seric # ifndef lint
10*16908Seric static char SmailSccsId[] =	"@(#)sendmail.h	4.8		08/11/84";
115194Seric # endif lint
124371Seric # else  _DEFINE
134371Seric # define EXTERN extern
144371Seric # endif _DEFINE
15295Seric 
164183Seric # include <stdio.h>
174183Seric # include <ctype.h>
187355Seric # include <setjmp.h>
199144Seric # include "conf.h"
201390Seric # include "useful.h"
211390Seric 
227674Seric # ifdef LOG
237674Seric # include <syslog.h>
247674Seric # endif LOG
2510679Seric 
2610679Seric 
2716907Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
2816907Seric 
2916907Seric 
3010679Seric /*
3110679Seric **  Data structure for bit maps.
3210679Seric **
3310679Seric **	Each bit in this map can be referenced by an ascii character.
3410679Seric **	This is 128 possible bits, or 12 8-bit bytes.
3510679Seric */
3610679Seric 
3710679Seric #define BITMAPBYTES	16	/* number of bytes in a bit map */
3810679Seric #define BYTEBITS	8	/* number of bits in a byte */
3910679Seric 
4010679Seric /* internal macros */
4110679Seric #define _BITWORD(bit)	(bit / (BYTEBITS * sizeof (int)))
4210679Seric #define _BITBIT(bit)	(1 << (bit % (BYTEBITS * sizeof (int))))
4310679Seric 
4410679Seric typedef int	BITMAP[BITMAPBYTES / sizeof (int)];
4510679Seric 
4610679Seric /* test bit number N */
4710679Seric #define bitnset(bit, map)	((map)[_BITWORD(bit)] & _BITBIT(bit))
4810679Seric 
4910679Seric /* set bit number N */
5010679Seric #define setbitn(bit, map)	(map)[_BITWORD(bit)] |= _BITBIT(bit)
5110679Seric 
5210679Seric /* clear bit number N */
5310679Seric #define clrbitn(bit, map)	(map)[_BITWORD(bit)] &= ~_BITBIT(bit)
5410679Seric 
5510679Seric /* clear an entire bit map */
5611053Seric #define clrbitmap(map)		bzero((char *) map, BITMAPBYTES)
577799Seric /*
583190Seric **  Address structure.
593190Seric **	Addresses are stored internally in this structure.
603190Seric */
613190Seric 
623190Seric struct address
633190Seric {
643190Seric 	char		*q_paddr;	/* the printname for the address */
653190Seric 	char		*q_user;	/* user name */
663190Seric 	char		*q_host;	/* host name */
674597Seric 	struct mailer	*q_mailer;	/* mailer to use */
684149Seric 	u_short		q_flags;	/* status flags, see below */
694213Seric 	short		q_uid;		/* user-id of receiver (if known) */
704398Seric 	short		q_gid;		/* group-id of receiver (if known) */
714079Seric 	char		*q_home;	/* home dir (local mailer only) */
724995Seric 	char		*q_fullname;	/* full name if known */
734995Seric 	struct address	*q_next;	/* chain */
744995Seric 	struct address	*q_alias;	/* address this results from */
755034Seric 	struct address	*q_tchain;	/* temporary use chain */
764987Seric 	time_t		q_timeout;	/* timeout for this address */
773190Seric };
783190Seric 
793190Seric typedef struct address ADDRESS;
803190Seric 
813190Seric # define QDONTSEND	000001	/* don't send to this address */
824068Seric # define QBADADDR	000002	/* this address is verified bad */
834403Seric # define QGOODUID	000004	/* the q_uid q_gid fields are good */
844422Seric # define QPRIMARY	000010	/* set from argv */
854624Seric # define QQUEUEUP	000020	/* queue for later transmission */
866902Seric /*
87295Seric **  Mailer definition structure.
88295Seric **	Every mailer known to the system is declared in this
89295Seric **	structure.  It defines the pathname of the mailer, some
90295Seric **	flags associated with it, and the argument vector to
911390Seric **	pass to it.  The flags are defined in conf.c
92295Seric **
934171Seric **	The argument vector is expanded before actual use.  All
944171Seric **	words except the first are passed through the macro
954171Seric **	processor.
96295Seric */
97295Seric 
98295Seric struct mailer
99295Seric {
1003190Seric 	char	*m_name;	/* symbolic name of this mailer */
101295Seric 	char	*m_mailer;	/* pathname of the mailer to use */
10210679Seric 	BITMAP	m_flags;	/* status flags, see below */
1034438Seric 	short	m_mno;		/* mailer number internally */
1043049Seric 	char	**m_argv;	/* template argument vector */
1058061Seric 	short	m_s_rwset;	/* rewriting set for sender addresses */
1068061Seric 	short	m_r_rwset;	/* rewriting set for recipient addresses */
10710323Seric 	char	*m_eol;		/* end of line string */
10810679Seric 	long	m_maxsize;	/* size limit on message to this mailer */
109295Seric };
110295Seric 
1114100Seric typedef struct mailer	MAILER;
1124100Seric 
1135601Seric /* bits for m_flags */
11416871Seric # define M_CANONICAL	'C'	/* make addresses canonical "u@dom" */
11516871Seric # define M_EXPENSIVE	'e'	/* it costs to use this mailer.... */
11616871Seric # define M_ESCFROM	'E'	/* escape From lines to >From */
11710679Seric # define M_FOPT		'f'	/* mailer takes picky -f flag */
11816871Seric # define M_HST_UPPER	'h'	/* preserve host case distinction */
11916871Seric # define M_INTERNAL	'I'	/* SMTP to another sendmail site */
12016871Seric # define M_LOCAL	'l'	/* delivery is to this host */
12116871Seric # define M_LIMITS	'L'	/* must enforce SMTP line limits */
12216871Seric # define M_MUSER	'm'	/* can handle multiple users at once */
12316871Seric # define M_NHDR		'n'	/* don't insert From line */
12416871Seric # define M_FROMPATH	'p'	/* use reverse-path in MAIL FROM: */
12510679Seric # define M_ROPT		'r'	/* mailer takes picky -r flag */
12616871Seric # define M_STRIPQ	's'	/* strip quote chars from user/host */
12710679Seric # define M_RESTR	'S'	/* must be daemon to execute */
12810679Seric # define M_USR_UPPER	'u'	/* preserve user case distinction */
12910679Seric # define M_UGLYUUCP	'U'	/* this wants an ugly UUCP from line */
13010679Seric # define M_XDOT		'X'	/* use hidden-dot algorithm */
131295Seric 
1324597Seric EXTERN MAILER	*Mailer[MAXMAILERS+1];
133295Seric 
1344597Seric EXTERN MAILER	*LocalMailer;		/* ptr to local mailer */
1354597Seric EXTERN MAILER	*ProgMailer;		/* ptr to program mailer */
1366902Seric /*
1372899Seric **  Header structure.
1382899Seric **	This structure is used internally to store header items.
1392899Seric */
140295Seric 
1412899Seric struct header
1422899Seric {
1432899Seric 	char		*h_field;	/* the name of the field */
1442899Seric 	char		*h_value;	/* the value of that field */
1452899Seric 	struct header	*h_link;	/* the next header */
1464149Seric 	u_short		h_flags;	/* status bits, see below */
14710679Seric 	BITMAP		h_mflags;	/* m_flags bits needed */
1482899Seric };
149295Seric 
1502899Seric typedef struct header	HDR;
1512899Seric 
152295Seric /*
1532899Seric **  Header information structure.
1542899Seric **	Defined in conf.c, this struct declares the header fields
1552899Seric **	that have some magic meaning.
1562899Seric */
1572899Seric 
1582899Seric struct hdrinfo
1592899Seric {
1602899Seric 	char	*hi_field;	/* the name of the field */
1614149Seric 	u_short	hi_flags;	/* status bits, see below */
1622899Seric };
1632899Seric 
1642899Seric extern struct hdrinfo	HdrInfo[];
1652899Seric 
1662899Seric /* bits for h_flags and hi_flags */
1673060Seric # define H_EOH		00001	/* this field terminates header */
1685918Seric # define H_RCPT		00002	/* contains recipient addresses */
1692899Seric # define H_DEFAULT	00004	/* if another value is found, drop this */
17011416Seric # define H_RESENT	00010	/* this address is a "Resent-..." address */
1713386Seric # define H_CHECK	00020	/* check h_mflags against m_flags */
1723390Seric # define H_ACHECK	00040	/* ditto, but always (not just default) */
1734149Seric # define H_FORCE	00100	/* force this field, even if default */
1748061Seric # define H_TRACE	00200	/* this field contains trace information */
1757761Seric # define H_FROM		00400	/* this is a from-type field */
1766902Seric /*
1776902Seric **  Envelope structure.
1786902Seric **	This structure defines the message itself.  There is usually
1796902Seric **	only one of these -- for the message that we originally read
1806902Seric **	and which is our primary interest -- but other envelopes can
1816902Seric **	be generated during processing.  For example, error messages
1826902Seric **	will have their own envelope.
1836902Seric */
1842899Seric 
1856902Seric struct envelope
1866902Seric {
1876987Seric 	HDR		*e_header;	/* head of header list */
1886987Seric 	long		e_msgpriority;	/* adjusted priority of this message */
1897859Seric 	time_t		e_ctime;	/* time message appeared in the queue */
1906987Seric 	char		*e_to;		/* the target person */
1918061Seric 	char		*e_receiptto;	/* return receipt address */
1926987Seric 	ADDRESS		e_from;		/* the person it is from */
1938180Seric 	char		**e_fromdomain;	/* the domain part of the sender */
1946987Seric 	ADDRESS		*e_sendqueue;	/* list of message recipients */
1957044Seric 	ADDRESS		*e_errorqueue;	/* the queue for error responses */
1966987Seric 	long		e_msgsize;	/* size of the message in bytes */
1976987Seric 	short		e_class;	/* msg class (priority, junk, etc.) */
1989336Seric 	short		e_flags;	/* flags, see below */
1999373Seric 	short		e_hopcount;	/* number of times processed */
2006987Seric 	int		(*e_puthdr)();	/* function to put header of message */
2016987Seric 	int		(*e_putbody)();	/* function to put body of message */
2026987Seric 	struct envelope	*e_parent;	/* the message this one encloses */
2039336Seric 	struct envelope *e_sibling;	/* the next envelope of interest */
2046987Seric 	char		*e_df;		/* location of temp file */
2059541Seric 	FILE		*e_dfp;		/* temporary file */
2067810Seric 	char		*e_id;		/* code for this entry in queue */
2079541Seric 	FILE		*e_xfp;		/* transcript file */
20810102Seric 	char		*e_message;	/* error message */
2096987Seric 	char		*e_macro[128];	/* macro definitions */
2106902Seric };
2112899Seric 
2126902Seric typedef struct envelope	ENVELOPE;
2134624Seric 
2149336Seric /* values for e_flags */
2159336Seric #define EF_OLDSTYLE	000001		/* use spaces (not commas) in hdrs */
2169336Seric #define EF_INQUEUE	000002		/* this message is fully queued */
2179336Seric #define EF_TIMEOUT	000004		/* this message is too old */
2189336Seric #define EF_CLRQUEUE	000010		/* disk copy is no longer needed */
2199336Seric #define EF_SENDRECEIPT	000020		/* send a return receipt */
2209336Seric #define EF_FATALERRS	000040		/* fatal errors occured */
2219336Seric #define EF_KEEPQUEUE	000100		/* keep queue files always */
2229373Seric #define EF_RESPONSE	000200		/* this is an error or return receipt */
22311416Seric #define EF_RESENT	000400		/* this message is being forwarded */
2249336Seric 
2256902Seric EXTERN ENVELOPE	*CurEnv;	/* envelope currently being processed */
2266902Seric /*
2274624Seric **  Message priorities.
2284633Seric **	Priorities > 0 should be preemptive.
2295034Seric **
2306902Seric **	CurEnv->e_msgpriority is the number of bytes in the message adjusted
2315034Seric **	by the message priority and the amount of time the message
2325034Seric **	has been sitting around.  Each priority point is worth
2335034Seric **	WKPRIFACT bytes of message, and each time we reprocess a
2345034Seric **	message the size gets reduced by WKTIMEFACT.
2356910Seric **
23612516Seric **	WKTIMEFACT is negative since jobs that fail once have a high
23712516Seric **	probability of failing again.  Making it negative tends to force
23812516Seric **	them to the back rather than the front of the queue, where they
23912516Seric **	only clog things.  Thanks go to Jay Lepreau at Utah for pointing
24012516Seric **	out the error in my thinking.
24112516Seric **
2426910Seric **	The "class" is this number, unadjusted by the age or size of
2436910Seric **	this message.  Classes with negative representations will have
2446910Seric **	error messages thrown away if they are not local.
2454624Seric */
2464624Seric 
2478249Seric struct priority
2488249Seric {
2498249Seric 	char	*pri_name;	/* external name of priority */
2508249Seric 	int	pri_val;	/* internal value for same */
2518249Seric };
2524624Seric 
2538249Seric EXTERN struct priority	Priorities[MAXPRIORITIES];
2548249Seric EXTERN int		NumPriorities;	/* pointer into Priorities */
2558249Seric 
2565034Seric # define WKPRIFACT	1800		/* bytes each pri point is worth */
25712516Seric # define WKTIMEFACT	(-600)		/* bytes each reprocessing is worth */
2586902Seric /*
2593153Seric **  Rewrite rules.
2603153Seric */
2612899Seric 
2623153Seric struct rewrite
2633153Seric {
2643153Seric 	char	**r_lhs;	/* pattern match */
2653153Seric 	char	**r_rhs;	/* substitution value */
2663153Seric 	struct rewrite	*r_next;/* next in chain */
2673153Seric };
2682899Seric 
2698057Seric EXTERN struct rewrite	*RewriteRules[MAXRWSETS];
2703153Seric 
2718057Seric /*
2728057Seric **  Special characters in rewriting rules.
2738057Seric **	These are used internally only.
2748057Seric **	The COND* rules are actually used in macros rather than in
2758057Seric **		rewriting rules, but are given here because they
2768057Seric **		cannot conflict.
2778057Seric */
2783153Seric 
2798057Seric /* left hand side items */
2808057Seric # define MATCHZANY	'\020'	/* match zero or more tokens */
2818057Seric # define MATCHANY	'\021'	/* match one or more tokens */
2828057Seric # define MATCHONE	'\022'	/* match exactly one token */
2838057Seric # define MATCHCLASS	'\023'	/* match one token in a class */
284*16908Seric # define MATCHNCLASS	'\024'	/* match anything not in class */
285*16908Seric # define MATCHREPL	'\025'	/* replacement on RHS for above */
2868057Seric 
2878057Seric /* right hand side items */
288*16908Seric # define CANONNET	'\026'	/* canonical net, next token */
289*16908Seric # define CANONHOST	'\027'	/* canonical host, next token */
290*16908Seric # define CANONUSER	'\030'	/* canonical user, next N tokens */
291*16908Seric # define CALLSUBR	'\031'	/* call another rewriting set */
2923153Seric 
2938057Seric /* conditionals in macros */
294*16908Seric # define CONDIF		'\032'	/* conditional if-then */
295*16908Seric # define CONDELSE	'\033'	/* conditional else */
296*16908Seric # define CONDFI		'\034'	/* conditional fi */
29716151Seric 
29816905Seric /* bracket characters for host name lookup */
299*16908Seric # define HOSTBEGIN	'\035'	/* hostname lookup begin */
300*16908Seric # define HOSTEND	'\036'	/* hostname lookup end */
30116905Seric 
30216151Seric /* \001 is also reserved as the macro expansion character */
3036902Seric /*
3044056Seric **  Symbol table definitions
3054056Seric */
3063153Seric 
3074056Seric struct symtab
3084056Seric {
3094056Seric 	char		*s_name;	/* name to be entered */
3104100Seric 	char		s_type;		/* general type (see below) */
3114056Seric 	struct symtab	*s_next;	/* pointer to next in chain */
3124100Seric 	union
3134100Seric 	{
31410679Seric 		BITMAP	sv_class;	/* bit-map of word classes */
3154100Seric 		ADDRESS	*sv_addr;	/* pointer to address header */
3164100Seric 		MAILER	*sv_mailer;	/* pointer to mailer */
3174100Seric 		char	*sv_alias;	/* alias */
3184100Seric 	}	s_value;
3194056Seric };
3204056Seric 
3214056Seric typedef struct symtab	STAB;
3224056Seric 
3234100Seric /* symbol types */
3244100Seric # define ST_UNDEF	0	/* undefined type */
3254100Seric # define ST_CLASS	1	/* class map */
3264100Seric # define ST_ADDRESS	2	/* an address in parsed format */
3274100Seric # define ST_MAILER	3	/* a mailer header */
3284100Seric # define ST_ALIAS	4	/* an alias */
3294100Seric 
3304100Seric # define s_class	s_value.sv_class
3315976Seric # define s_address	s_value.sv_addr
3324100Seric # define s_mailer	s_value.sv_mailer
3334100Seric # define s_alias	s_value.sv_alias
3344100Seric 
3354056Seric extern STAB	*stab();
3364056Seric 
3374056Seric /* opcodes to stab */
3384056Seric # define ST_FIND	0	/* find entry */
3394056Seric # define ST_ENTER	1	/* enter if not there */
3406902Seric /*
3417684Seric **  STRUCT EVENT -- event queue.
3427684Seric **
3437684Seric **	Maintained in sorted order.
3447931Seric **
3457931Seric **	We store the pid of the process that set this event to insure
3467931Seric **	that when we fork we will not take events intended for the parent.
3477684Seric */
3487684Seric 
3497684Seric struct event
3507684Seric {
3517684Seric 	time_t		ev_time;	/* time of the function call */
3527684Seric 	int		(*ev_func)();	/* function to call */
3537684Seric 	int		ev_arg;		/* argument to ev_func */
3547931Seric 	int		ev_pid;		/* pid that set this event */
3557684Seric 	struct event	*ev_link;	/* link to next item */
3567684Seric };
3577684Seric 
3587684Seric typedef struct event	EVENT;
3597684Seric 
3607684Seric EXTERN EVENT	*EventQueue;		/* head of event queue */
3617684Seric /*
3629373Seric **  Operation, send, and error modes
3639278Seric **
3649278Seric **	The operation mode describes the basic operation of sendmail.
3659278Seric **	This can be set from the command line, and is "send mail" by
3669278Seric **	default.
3679278Seric **
3689278Seric **	The send mode tells how to send mail.  It can be set in the
3699278Seric **	configuration file.  It's setting determines how quickly the
3709278Seric **	mail will be delivered versus the load on your system.  If the
3719278Seric **	-v (verbose) flag is given, it will be forced to SM_DELIVER
3729278Seric **	mode.
3739278Seric **
3749373Seric **	The error mode tells how to return errors.
3756997Seric */
3766997Seric 
3779278Seric EXTERN char	OpMode;		/* operation mode, see below */
3786997Seric 
3799278Seric #define MD_DELIVER	'm'		/* be a mail sender */
3809278Seric #define MD_ARPAFTP	'a'		/* old-style arpanet protocols */
3819278Seric #define MD_SMTP		's'		/* run SMTP on standard input */
3826997Seric #define MD_DAEMON	'd'		/* run as a daemon */
3836997Seric #define MD_VERIFY	'v'		/* verify: don't collect or deliver */
3848334Seric #define MD_TEST		't'		/* test mode: resolve addrs only */
3859144Seric #define MD_INITALIAS	'i'		/* initialize alias database */
3869144Seric #define MD_PRINT	'p'		/* print the queue */
3879144Seric #define MD_FREEZE	'z'		/* freeze the configuration file */
3886997Seric 
3899278Seric 
3909278Seric EXTERN char	SendMode;	/* send mode, see below */
3919278Seric 
3929278Seric #define SM_DELIVER	'i'		/* interactive delivery */
3939278Seric #define SM_QUICKD	'j'		/* deliver w/o queueing */
3949278Seric #define SM_FORK		'b'		/* deliver in background */
3959278Seric #define SM_QUEUE	'q'		/* queue, don't deliver */
3969278Seric #define SM_VERIFY	'v'		/* verify only (used internally) */
3979373Seric 
39814871Seric /* used only as a parameter to sendall */
39914871Seric #define SM_DEFAULT	'\0'		/* unspecified, use SendMode */
4009373Seric 
40114871Seric 
4029373Seric EXTERN char	ErrorMode;	/* error mode, see below */
4039373Seric 
4049373Seric #define EM_PRINT	'p'		/* print errors */
4059373Seric #define EM_MAIL		'm'		/* mail back errors */
4069373Seric #define EM_WRITE	'w'		/* write back errors */
4079373Seric #define EM_BERKNET	'e'		/* special berknet processing */
4089373Seric #define EM_QUIET	'q'		/* don't print messages (stat only) */
4096997Seric /*
410295Seric **  Global variables.
411295Seric */
412295Seric 
4134371Seric EXTERN bool	FromFlag;	/* if set, "From" person is explicit */
4144371Seric EXTERN bool	NoAlias;	/* if set, don't do any aliasing */
4154371Seric EXTERN bool	ForceMail;	/* if set, mail even if already got a copy */
4164371Seric EXTERN bool	MeToo;		/* send to the sender also */
4174371Seric EXTERN bool	IgnrDot;	/* don't let dot end messages */
4184371Seric EXTERN bool	SaveFrom;	/* save leading "From" lines */
4194371Seric EXTERN bool	Verbose;	/* set if blow-by-blow desired */
4204371Seric EXTERN bool	GrabTo;		/* if set, get recipients from msg */
4214371Seric EXTERN bool	NoReturn;	/* don't return letter to sender */
4224553Seric EXTERN bool	SuprErrs;	/* set if we are suppressing errors */
4236049Seric EXTERN bool	QueueRun;	/* currently running message from the queue */
4244711Seric EXTERN bool	HoldErrs;	/* only output errors to transcript */
4255904Seric EXTERN bool	NoConnect;	/* don't connect to non-local mailers */
4268268Seric EXTERN bool	SuperSafe;	/* be extra careful, even if expensive */
4278929Seric EXTERN bool	SafeAlias;	/* alias file must have "@:@" to be complete */
4289144Seric EXTERN bool	AutoRebuild;	/* auto-rebuild the alias database as needed */
4298268Seric EXTERN time_t	TimeOut;	/* time until timeout */
4304553Seric EXTERN FILE	*InChannel;	/* input connection */
4314553Seric EXTERN FILE	*OutChannel;	/* output connection */
4324537Seric EXTERN int	RealUid;	/* when Daemon, real uid of caller */
4334537Seric EXTERN int	RealGid;	/* when Daemon, real gid of caller */
4348268Seric EXTERN int	DefUid;		/* default uid to run as */
4358268Seric EXTERN int	DefGid;		/* default gid to run as */
4364371Seric EXTERN int	OldUmask;	/* umask when sendmail starts up */
4376049Seric EXTERN int	Errors;		/* set if errors (local to single pass) */
4384371Seric EXTERN int	ExitStat;	/* exit status code */
4394553Seric EXTERN int	AliasLevel;	/* depth of aliasing */
4407282Seric EXTERN int	MotherPid;	/* proc id of parent process */
4418057Seric EXTERN int	LineNumber;	/* line number in current input */
44216139Seric EXTERN time_t	ReadTimeout;	/* timeout on reads */
4438268Seric EXTERN int	LogLevel;	/* level of logging to perform */
4449045Seric EXTERN int	FileMode;	/* mode on files */
4454624Seric EXTERN time_t	QueueIntvl;	/* intervals between running the queue */
4464553Seric EXTERN char	*HostName;	/* name of this host for SMTP messages */
4478268Seric EXTERN char	*AliasFile;	/* location of alias file */
4488268Seric EXTERN char	*HelpFile;	/* location of SMTP help file */
4498268Seric EXTERN char	*StatFile;	/* location of statistics summary */
4508268Seric EXTERN char	*QueueDir;	/* location of queue directory */
4519373Seric EXTERN char	*FileName;	/* name to print on error messages */
4528929Seric EXTERN char	*TrustedUsers[MAXTRUST+1];	/* list of trusted users */
4538268Seric EXTERN jmp_buf	TopFrame;	/* branch-to-top-of-loop-on-error frame */
4548268Seric EXTERN bool	QuickAbort;	/*  .... but only if we want a quick abort */
4557859Seric extern char	*ConfFile;	/* location of configuration file [conf.c] */
4569065Seric extern char	*FreezeFile;	/* location of frozen memory image [conf.c] */
4577859Seric extern char	Arpa_Info[];	/* the reply code for Arpanet info [conf.c] */
4589041Seric extern char	SpaceSub;	/* substitution for <lwsp> [conf.c] */
4597674Seric /*
4607674Seric **  Trace information
4617674Seric */
462295Seric 
4637674Seric /* trace vector and macros for debugging flags */
4647674Seric EXTERN u_char	tTdvect[100];
4657674Seric # define tTd(flag, level)	(tTdvect[flag] >= level)
4667674Seric # define tTdlevel(flag)		(tTdvect[flag])
4677674Seric /*
4687674Seric **  Miscellaneous information.
4697674Seric */
470295Seric 
471295Seric # include	<sysexits.h>
472295Seric 
47310213Seric 
47410213Seric /*
47510213Seric **  Some in-line functions
47610213Seric */
47710213Seric 
47810213Seric /* set exit status */
47911426Seric #define setstat(s)	{ \
48011426Seric 				if (ExitStat == EX_OK || ExitStat == EX_TEMPFAIL) \
48111426Seric 					ExitStat = s; \
48211426Seric 			}
4834085Seric 
48410213Seric /* make a copy of a string */
48511426Seric #define newstr(s)	strcpy(xalloc(strlen(s) + 1), s)
4864085Seric 
48710213Seric 
48810213Seric /*
48910213Seric **  Declarations of useful functions
49010213Seric */
49110213Seric 
4929883Seric extern ADDRESS	*parseaddr();
4934085Seric extern char	*xalloc();
4944085Seric extern bool	sameaddr();
4956889Seric extern FILE	*dfopen();
4967684Seric extern EVENT	*setevent();
4977684Seric extern char	*sfgets();
4987810Seric extern char	*queuename();
4997884Seric extern time_t	curtime();
500