1 /* 2 * Copyright (c) 1983 Eric P. Allman 3 * Copyright (c) 1988 Regents of the University of California. 4 * All rights reserved. 5 * 6 * %sccs.include.redist.c% 7 * 8 * @(#)sendmail.h 5.28 (Berkeley) 01/04/92 9 */ 10 11 /* 12 ** SENDMAIL.H -- Global definitions for sendmail. 13 */ 14 15 # ifdef _DEFINE 16 # define EXTERN 17 # ifndef lint 18 static char SmailSccsId[] = "@(#)sendmail.h 5.28 01/04/92"; 19 # endif lint 20 # else _DEFINE 21 # define EXTERN extern 22 # endif _DEFINE 23 24 # include <sys/types.h> 25 # include <stdio.h> 26 # include <ctype.h> 27 # include <setjmp.h> 28 # include <sysexits.h> 29 # include "conf.h" 30 # include "useful.h" 31 32 # ifdef LOG 33 # include <sys/syslog.h> 34 # endif LOG 35 36 # ifdef DAEMON 37 # ifdef VMUNIX 38 # include <sys/socket.h> 39 # include <netinet/in.h> 40 # endif VMUNIX 41 # endif DAEMON 42 43 44 # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 45 46 47 /* 48 ** Data structure for bit maps. 49 ** 50 ** Each bit in this map can be referenced by an ascii character. 51 ** This is 128 possible bits, or 12 8-bit bytes. 52 */ 53 54 #define BITMAPBYTES 16 /* number of bytes in a bit map */ 55 #define BYTEBITS 8 /* number of bits in a byte */ 56 57 /* internal macros */ 58 #define _BITWORD(bit) (bit / (BYTEBITS * sizeof (int))) 59 #define _BITBIT(bit) (1 << (bit % (BYTEBITS * sizeof (int)))) 60 61 typedef int BITMAP[BITMAPBYTES / sizeof (int)]; 62 63 /* test bit number N */ 64 #define bitnset(bit, map) ((map)[_BITWORD(bit)] & _BITBIT(bit)) 65 66 /* set bit number N */ 67 #define setbitn(bit, map) (map)[_BITWORD(bit)] |= _BITBIT(bit) 68 69 /* clear bit number N */ 70 #define clrbitn(bit, map) (map)[_BITWORD(bit)] &= ~_BITBIT(bit) 71 72 /* clear an entire bit map */ 73 #define clrbitmap(map) bzero((char *) map, BITMAPBYTES) 74 /* 75 ** Address structure. 76 ** Addresses are stored internally in this structure. 77 */ 78 79 struct address 80 { 81 char *q_paddr; /* the printname for the address */ 82 char *q_user; /* user name */ 83 char *q_ruser; /* real user name, or NULL if q_user */ 84 char *q_host; /* host name */ 85 struct mailer *q_mailer; /* mailer to use */ 86 u_short q_flags; /* status flags, see below */ 87 short q_uid; /* user-id of receiver (if known) */ 88 short q_gid; /* group-id of receiver (if known) */ 89 char *q_home; /* home dir (local mailer only) */ 90 char *q_fullname; /* full name if known */ 91 struct address *q_next; /* chain */ 92 struct address *q_alias; /* address this results from */ 93 struct address *q_tchain; /* temporary use chain */ 94 time_t q_timeout; /* timeout for this address */ 95 }; 96 97 typedef struct address ADDRESS; 98 99 # define QDONTSEND 000001 /* don't send to this address */ 100 # define QBADADDR 000002 /* this address is verified bad */ 101 # define QGOODUID 000004 /* the q_uid q_gid fields are good */ 102 # define QPRIMARY 000010 /* set from argv */ 103 # define QQUEUEUP 000020 /* queue for later transmission */ 104 # define QSENT 000040 /* has been successfully delivered */ 105 # define QNOTREMOTE 000100 /* not an address for remote forwarding */ 106 /* 107 ** Mailer definition structure. 108 ** Every mailer known to the system is declared in this 109 ** structure. It defines the pathname of the mailer, some 110 ** flags associated with it, and the argument vector to 111 ** pass to it. The flags are defined in conf.c 112 ** 113 ** The argument vector is expanded before actual use. All 114 ** words except the first are passed through the macro 115 ** processor. 116 */ 117 118 struct mailer 119 { 120 char *m_name; /* symbolic name of this mailer */ 121 char *m_mailer; /* pathname of the mailer to use */ 122 BITMAP m_flags; /* status flags, see below */ 123 short m_mno; /* mailer number internally */ 124 char **m_argv; /* template argument vector */ 125 short m_s_rwset; /* rewriting set for sender addresses */ 126 short m_r_rwset; /* rewriting set for recipient addresses */ 127 char *m_eol; /* end of line string */ 128 long m_maxsize; /* size limit on message to this mailer */ 129 int m_linelimit; /* max # characters per line */ 130 }; 131 132 typedef struct mailer MAILER; 133 134 /* bits for m_flags */ 135 # define M_CANONICAL 'C' /* make addresses canonical "u@dom" */ 136 # define M_EXPENSIVE 'e' /* it costs to use this mailer.... */ 137 # define M_ESCFROM 'E' /* escape From lines to >From */ 138 # define M_FOPT 'f' /* mailer takes picky -f flag */ 139 # define M_HST_UPPER 'h' /* preserve host case distinction */ 140 # define M_INTERNAL 'I' /* SMTP to another sendmail site */ 141 # define M_LOCAL 'l' /* delivery is to this host */ 142 # define M_LIMITS 'L' /* must enforce SMTP line limits */ 143 # define M_MUSER 'm' /* can handle multiple users at once */ 144 # define M_NHDR 'n' /* don't insert From line */ 145 # define M_FROMPATH 'p' /* use reverse-path in MAIL FROM: */ 146 # define M_ROPT 'r' /* mailer takes picky -r flag */ 147 # define M_SECURE_PORT 'R' /* try to send on a reserved TCP port */ 148 # define M_STRIPQ 's' /* strip quote chars from user/host */ 149 # define M_RESTR 'S' /* must be daemon to execute */ 150 # define M_USR_UPPER 'u' /* preserve user case distinction */ 151 # define M_UGLYUUCP 'U' /* this wants an ugly UUCP from line */ 152 # define M_XDOT 'X' /* use hidden-dot algorithm */ 153 # define M_7BITS '7' /* use 7-bit path */ 154 # define M_8BITS '8' /* use 8-bit path */ 155 156 EXTERN MAILER *Mailer[MAXMAILERS+1]; 157 158 EXTERN MAILER *LocalMailer; /* ptr to local mailer */ 159 EXTERN MAILER *ProgMailer; /* ptr to program mailer */ 160 /* 161 ** Header structure. 162 ** This structure is used internally to store header items. 163 */ 164 165 struct header 166 { 167 char *h_field; /* the name of the field */ 168 char *h_value; /* the value of that field */ 169 struct header *h_link; /* the next header */ 170 u_short h_flags; /* status bits, see below */ 171 BITMAP h_mflags; /* m_flags bits needed */ 172 }; 173 174 typedef struct header HDR; 175 176 /* 177 ** Header information structure. 178 ** Defined in conf.c, this struct declares the header fields 179 ** that have some magic meaning. 180 */ 181 182 struct hdrinfo 183 { 184 char *hi_field; /* the name of the field */ 185 u_short hi_flags; /* status bits, see below */ 186 }; 187 188 extern struct hdrinfo HdrInfo[]; 189 190 /* bits for h_flags and hi_flags */ 191 # define H_EOH 00001 /* this field terminates header */ 192 # define H_RCPT 00002 /* contains recipient addresses */ 193 # define H_DEFAULT 00004 /* if another value is found, drop this */ 194 # define H_RESENT 00010 /* this address is a "Resent-..." address */ 195 # define H_CHECK 00020 /* check h_mflags against m_flags */ 196 # define H_ACHECK 00040 /* ditto, but always (not just default) */ 197 # define H_FORCE 00100 /* force this field, even if default */ 198 # define H_TRACE 00200 /* this field contains trace information */ 199 # define H_FROM 00400 /* this is a from-type field */ 200 # define H_VALID 01000 /* this field has a validated value */ 201 /* 202 ** Envelope structure. 203 ** This structure defines the message itself. There is usually 204 ** only one of these -- for the message that we originally read 205 ** and which is our primary interest -- but other envelopes can 206 ** be generated during processing. For example, error messages 207 ** will have their own envelope. 208 */ 209 210 struct envelope 211 { 212 HDR *e_header; /* head of header list */ 213 long e_msgpriority; /* adjusted priority of this message */ 214 time_t e_ctime; /* time message appeared in the queue */ 215 char *e_to; /* the target person */ 216 char *e_receiptto; /* return receipt address */ 217 ADDRESS e_from; /* the person it is from */ 218 char *e_sender; /* string version of from person */ 219 char *e_returnpath; /* string version of return path */ 220 char **e_fromdomain; /* the domain part of the sender */ 221 ADDRESS *e_sendqueue; /* list of message recipients */ 222 ADDRESS *e_errorqueue; /* the queue for error responses */ 223 long e_msgsize; /* size of the message in bytes */ 224 int e_nrcpts; /* number of recipients */ 225 short e_class; /* msg class (priority, junk, etc.) */ 226 short e_flags; /* flags, see below */ 227 short e_hopcount; /* number of times processed */ 228 int (*e_puthdr)(); /* function to put header of message */ 229 int (*e_putbody)(); /* function to put body of message */ 230 struct envelope *e_parent; /* the message this one encloses */ 231 struct envelope *e_sibling; /* the next envelope of interest */ 232 char *e_df; /* location of temp file */ 233 FILE *e_dfp; /* temporary file */ 234 char *e_id; /* code for this entry in queue */ 235 FILE *e_xfp; /* transcript file */ 236 FILE *e_lockfp; /* the lock file for this message */ 237 char *e_message; /* error message */ 238 char *e_macro[128]; /* macro definitions */ 239 }; 240 241 typedef struct envelope ENVELOPE; 242 243 /* values for e_flags */ 244 #define EF_OLDSTYLE 000001 /* use spaces (not commas) in hdrs */ 245 #define EF_INQUEUE 000002 /* this message is fully queued */ 246 #define EF_TIMEOUT 000004 /* this message is too old */ 247 #define EF_CLRQUEUE 000010 /* disk copy is no longer needed */ 248 #define EF_SENDRECEIPT 000020 /* send a return receipt */ 249 #define EF_FATALERRS 000040 /* fatal errors occured */ 250 #define EF_KEEPQUEUE 000100 /* keep queue files always */ 251 #define EF_RESPONSE 000200 /* this is an error or return receipt */ 252 #define EF_RESENT 000400 /* this message is being forwarded */ 253 254 EXTERN ENVELOPE *CurEnv; /* envelope currently being processed */ 255 /* 256 ** Message priority classes. 257 ** 258 ** The message class is read directly from the Priority: header 259 ** field in the message. 260 ** 261 ** CurEnv->e_msgpriority is the number of bytes in the message plus 262 ** the creation time (so that jobs ``tend'' to be ordered correctly), 263 ** adjusted by the message class, the number of recipients, and the 264 ** amount of time the message has been sitting around. This number 265 ** is used to order the queue. Higher values mean LOWER priority. 266 ** 267 ** Each priority class point is worth WkClassFact priority points; 268 ** each recipient is worth WkRecipFact priority points. Each time 269 ** we reprocess a message the priority is adjusted by WkTimeFact. 270 ** WkTimeFact should normally decrease the priority so that jobs 271 ** that have historically failed will be run later; thanks go to 272 ** Jay Lepreau at Utah for pointing out the error in my thinking. 273 ** 274 ** The "class" is this number, unadjusted by the age or size of 275 ** this message. Classes with negative representations will have 276 ** error messages thrown away if they are not local. 277 */ 278 279 struct priority 280 { 281 char *pri_name; /* external name of priority */ 282 int pri_val; /* internal value for same */ 283 }; 284 285 EXTERN struct priority Priorities[MAXPRIORITIES]; 286 EXTERN int NumPriorities; /* pointer into Priorities */ 287 /* 288 ** Rewrite rules. 289 */ 290 291 struct rewrite 292 { 293 char **r_lhs; /* pattern match */ 294 char **r_rhs; /* substitution value */ 295 struct rewrite *r_next;/* next in chain */ 296 }; 297 298 EXTERN struct rewrite *RewriteRules[MAXRWSETS]; 299 300 /* 301 ** Special characters in rewriting rules. 302 ** These are used internally only. 303 ** The COND* rules are actually used in macros rather than in 304 ** rewriting rules, but are given here because they 305 ** cannot conflict. 306 */ 307 308 /* left hand side items */ 309 # define MATCHZANY '\020' /* match zero or more tokens */ 310 # define MATCHANY '\021' /* match one or more tokens */ 311 # define MATCHONE '\022' /* match exactly one token */ 312 # define MATCHCLASS '\023' /* match one token in a class */ 313 # define MATCHNCLASS '\024' /* match anything not in class */ 314 # define MATCHREPL '\025' /* replacement on RHS for above */ 315 316 /* right hand side items */ 317 # define CANONNET '\026' /* canonical net, next token */ 318 # define CANONHOST '\027' /* canonical host, next token */ 319 # define CANONUSER '\030' /* canonical user, next N tokens */ 320 # define CALLSUBR '\031' /* call another rewriting set */ 321 322 /* conditionals in macros */ 323 # define CONDIF '\032' /* conditional if-then */ 324 # define CONDELSE '\033' /* conditional else */ 325 # define CONDFI '\034' /* conditional fi */ 326 327 /* bracket characters for host name lookup */ 328 # define HOSTBEGIN '\035' /* hostname lookup begin */ 329 # define HOSTEND '\036' /* hostname lookup end */ 330 331 /* \001 is also reserved as the macro expansion character */ 332 333 /* external <==> internal mapping table */ 334 struct metamac 335 { 336 char metaname; /* external code (after $) */ 337 char metaval; /* internal code (as above) */ 338 }; 339 /* 340 ** Information about hosts that we have looked up recently. 341 ** 342 ** This stuff is 4.2/3bsd specific. 343 */ 344 345 # ifdef DAEMON 346 # ifdef VMUNIX 347 348 # define HOSTINFO struct hostinfo 349 350 HOSTINFO 351 { 352 char *ho_name; /* name of this host */ 353 struct in_addr ho_inaddr; /* internet address */ 354 short ho_flags; /* flag bits, see below */ 355 short ho_errno; /* error number on last connection */ 356 short ho_exitstat; /* exit status from last connection */ 357 }; 358 359 360 /* flag bits */ 361 #define HOF_VALID 00001 /* this entry is valid */ 362 363 # endif VMUNIX 364 # endif DAEMON 365 /* 366 ** Symbol table definitions 367 */ 368 369 struct symtab 370 { 371 char *s_name; /* name to be entered */ 372 char s_type; /* general type (see below) */ 373 struct symtab *s_next; /* pointer to next in chain */ 374 union 375 { 376 BITMAP sv_class; /* bit-map of word classes */ 377 ADDRESS *sv_addr; /* pointer to address header */ 378 MAILER *sv_mailer; /* pointer to mailer */ 379 char *sv_alias; /* alias */ 380 # ifdef HOSTINFO 381 HOSTINFO sv_host; /* host information */ 382 # endif HOSTINFO 383 } s_value; 384 }; 385 386 typedef struct symtab STAB; 387 388 /* symbol types */ 389 # define ST_UNDEF 0 /* undefined type */ 390 # define ST_CLASS 1 /* class map */ 391 # define ST_ADDRESS 2 /* an address in parsed format */ 392 # define ST_MAILER 3 /* a mailer header */ 393 # define ST_ALIAS 4 /* an alias */ 394 # define ST_HOST 5 /* host information */ 395 396 # define s_class s_value.sv_class 397 # define s_address s_value.sv_addr 398 # define s_mailer s_value.sv_mailer 399 # define s_alias s_value.sv_alias 400 # undef s_host 401 # define s_host s_value.sv_host 402 403 extern STAB *stab(); 404 405 /* opcodes to stab */ 406 # define ST_FIND 0 /* find entry */ 407 # define ST_ENTER 1 /* enter if not there */ 408 /* 409 ** STRUCT EVENT -- event queue. 410 ** 411 ** Maintained in sorted order. 412 ** 413 ** We store the pid of the process that set this event to insure 414 ** that when we fork we will not take events intended for the parent. 415 */ 416 417 struct event 418 { 419 time_t ev_time; /* time of the function call */ 420 int (*ev_func)(); /* function to call */ 421 int ev_arg; /* argument to ev_func */ 422 int ev_pid; /* pid that set this event */ 423 struct event *ev_link; /* link to next item */ 424 }; 425 426 typedef struct event EVENT; 427 428 EXTERN EVENT *EventQueue; /* head of event queue */ 429 /* 430 ** Operation, send, and error modes 431 ** 432 ** The operation mode describes the basic operation of sendmail. 433 ** This can be set from the command line, and is "send mail" by 434 ** default. 435 ** 436 ** The send mode tells how to send mail. It can be set in the 437 ** configuration file. It's setting determines how quickly the 438 ** mail will be delivered versus the load on your system. If the 439 ** -v (verbose) flag is given, it will be forced to SM_DELIVER 440 ** mode. 441 ** 442 ** The error mode tells how to return errors. 443 */ 444 445 EXTERN char OpMode; /* operation mode, see below */ 446 447 #define MD_DELIVER 'm' /* be a mail sender */ 448 #define MD_ARPAFTP 'a' /* old-style arpanet protocols */ 449 #define MD_SMTP 's' /* run SMTP on standard input */ 450 #define MD_DAEMON 'd' /* run as a daemon */ 451 #define MD_VERIFY 'v' /* verify: don't collect or deliver */ 452 #define MD_TEST 't' /* test mode: resolve addrs only */ 453 #define MD_INITALIAS 'i' /* initialize alias database */ 454 #define MD_PRINT 'p' /* print the queue */ 455 #define MD_FREEZE 'z' /* freeze the configuration file */ 456 457 458 EXTERN char SendMode; /* send mode, see below */ 459 460 #define SM_DELIVER 'i' /* interactive delivery */ 461 #define SM_QUICKD 'j' /* deliver w/o queueing */ 462 #define SM_FORK 'b' /* deliver in background */ 463 #define SM_QUEUE 'q' /* queue, don't deliver */ 464 #define SM_VERIFY 'v' /* verify only (used internally) */ 465 466 /* used only as a parameter to sendall */ 467 #define SM_DEFAULT '\0' /* unspecified, use SendMode */ 468 469 470 EXTERN char ErrorMode; /* error mode, see below */ 471 472 #define EM_PRINT 'p' /* print errors */ 473 #define EM_MAIL 'm' /* mail back errors */ 474 #define EM_WRITE 'w' /* write back errors */ 475 #define EM_BERKNET 'e' /* special berknet processing */ 476 #define EM_QUIET 'q' /* don't print messages (stat only) */ 477 478 /* offset used to issure that the error messages for name server error 479 * codes are unique. 480 */ 481 #define MAX_ERRNO 100 482 /* 483 ** Global variables. 484 */ 485 486 EXTERN bool FromFlag; /* if set, "From" person is explicit */ 487 EXTERN bool NoAlias; /* if set, don't do any aliasing */ 488 EXTERN bool ForceMail; /* if set, mail even if already got a copy */ 489 EXTERN bool MeToo; /* send to the sender also */ 490 EXTERN bool IgnrDot; /* don't let dot end messages */ 491 EXTERN bool SaveFrom; /* save leading "From" lines */ 492 EXTERN bool Verbose; /* set if blow-by-blow desired */ 493 EXTERN bool GrabTo; /* if set, get recipients from msg */ 494 EXTERN bool NoReturn; /* don't return letter to sender */ 495 EXTERN bool SuprErrs; /* set if we are suppressing errors */ 496 EXTERN bool QueueRun; /* currently running message from the queue */ 497 EXTERN bool HoldErrs; /* only output errors to transcript */ 498 EXTERN bool NoConnect; /* don't connect to non-local mailers */ 499 EXTERN bool SuperSafe; /* be extra careful, even if expensive */ 500 EXTERN bool ForkQueueRuns; /* fork for each job when running the queue */ 501 EXTERN bool AutoRebuild; /* auto-rebuild the alias database as needed */ 502 EXTERN bool CheckAliases; /* parse addresses during newaliases */ 503 EXTERN bool UseNameServer; /* use internet domain name server */ 504 EXTERN bool EightBit; /* try to preserve 8-bit data */ 505 EXTERN int SafeAlias; /* minutes to wait until @:@ in alias file */ 506 EXTERN time_t TimeOut; /* time until timeout */ 507 EXTERN FILE *InChannel; /* input connection */ 508 EXTERN FILE *OutChannel; /* output connection */ 509 EXTERN int RealUid; /* when Daemon, real uid of caller */ 510 EXTERN int RealGid; /* when Daemon, real gid of caller */ 511 EXTERN int DefUid; /* default uid to run as */ 512 EXTERN char *DefUser; /* default user to run as (from DefUid) */ 513 EXTERN int DefGid; /* default gid to run as */ 514 EXTERN int OldUmask; /* umask when sendmail starts up */ 515 EXTERN int Errors; /* set if errors (local to single pass) */ 516 EXTERN int ExitStat; /* exit status code */ 517 EXTERN int AliasLevel; /* depth of aliasing */ 518 EXTERN int MotherPid; /* proc id of parent process */ 519 EXTERN int LineNumber; /* line number in current input */ 520 EXTERN time_t ReadTimeout; /* timeout on reads */ 521 EXTERN int LogLevel; /* level of logging to perform */ 522 EXTERN int FileMode; /* mode on files */ 523 EXTERN int QueueLA; /* load average starting forced queueing */ 524 EXTERN int RefuseLA; /* load average refusing connections are */ 525 EXTERN int CurrentLA; /* current load average */ 526 EXTERN int QueueFactor; /* slope of queue function */ 527 EXTERN time_t QueueIntvl; /* intervals between running the queue */ 528 EXTERN char *AliasFile; /* location of alias file */ 529 EXTERN char *HelpFile; /* location of SMTP help file */ 530 EXTERN char *StatFile; /* location of statistics summary */ 531 EXTERN char *QueueDir; /* location of queue directory */ 532 EXTERN char *FileName; /* name to print on error messages */ 533 EXTERN char *SmtpPhase; /* current phase in SMTP processing */ 534 EXTERN char *MyHostName; /* name of this host for SMTP messages */ 535 EXTERN char *RealHostName; /* name of host we are talking to */ 536 EXTERN struct sockaddr_in RealHostAddr;/* address of host we are talking to */ 537 EXTERN char *CurHostName; /* current host we are dealing with */ 538 EXTERN jmp_buf TopFrame; /* branch-to-top-of-loop-on-error frame */ 539 EXTERN bool QuickAbort; /* .... but only if we want a quick abort */ 540 EXTERN bool LogUsrErrs; /* syslog user errors (e.g., SMTP RCPT cmd) */ 541 extern char *ConfFile; /* location of configuration file [conf.c] */ 542 extern char *FreezeFile; /* location of frozen memory image [conf.c] */ 543 extern char Arpa_Info[]; /* the reply code for Arpanet info [conf.c] */ 544 extern ADDRESS NullAddress; /* a null (template) address [main.c] */ 545 EXTERN char SpaceSub; /* substitution for <lwsp> */ 546 EXTERN int WkClassFact; /* multiplier for message class -> priority */ 547 EXTERN int WkRecipFact; /* multiplier for # of recipients -> priority */ 548 EXTERN int WkTimeFact; /* priority offset each time this job is run */ 549 EXTERN int Nmx; /* number of MX RRs */ 550 EXTERN char *PostMasterCopy; /* address to get errs cc's */ 551 EXTERN char *MxHosts[MAXMXHOSTS+1]; /* for MX RRs */ 552 EXTERN char *TrustedUsers[MAXTRUST+1]; /* list of trusted users */ 553 EXTERN char *UserEnviron[MAXUSERENVIRON+1]; /* saved user environment */ 554 EXTERN int CheckpointInterval; /* queue file checkpoint interval */ 555 EXTERN bool NoWildcardMX; /* we don't have wildcard MX records */ 556 EXTERN char *UdbSpec; /* user database source spec [udbexpand.c] */ 557 EXTERN int MaxHopCount; /* number of hops until we give an error */ 558 EXTERN int ConfigLevel; /* config file level -- what does .cf expect? */ 559 EXTERN char *TimeZoneSpec; /* override time zone specification */ 560 /* 561 ** Trace information 562 */ 563 564 /* trace vector and macros for debugging flags */ 565 EXTERN u_char tTdvect[100]; 566 # define tTd(flag, level) (tTdvect[flag] >= level) 567 # define tTdlevel(flag) (tTdvect[flag]) 568 /* 569 ** Miscellaneous information. 570 */ 571 572 573 574 /* 575 ** Some in-line functions 576 */ 577 578 /* set exit status */ 579 #define setstat(s) { \ 580 if (ExitStat == EX_OK || ExitStat == EX_TEMPFAIL) \ 581 ExitStat = s; \ 582 } 583 584 /* make a copy of a string */ 585 #define newstr(s) strcpy(xalloc(strlen(s) + 1), s) 586 587 #define STRUCTCOPY(s, d) d = s 588 589 590 /* 591 ** Declarations of useful functions 592 */ 593 594 extern ADDRESS *parseaddr(); 595 extern char *xalloc(); 596 extern bool sameaddr(); 597 extern FILE *dfopen(); 598 extern EVENT *setevent(); 599 extern char *sfgets(); 600 extern char *queuename(); 601 extern time_t curtime(); 602