📄 sendmail.h
字号:
** These are used internally only.** The COND* rules are actually used in macros rather than in** rewriting rules, but are given here because they** cannot conflict.*//* left hand side items */# define MATCHZANY '\020' /* match zero or more tokens */# define MATCHANY '\021' /* match one or more tokens */# define MATCHONE '\022' /* match exactly one token */# define MATCHCLASS '\023' /* match one token in a class */# define MATCHNCLASS '\024' /* match anything not in class */# define MATCHREPL '\025' /* replacement on RHS for above *//* right hand side items */# define CANONNET '\026' /* canonical net, next token */# define CANONHOST '\027' /* canonical host, next token */# define CANONUSER '\030' /* canonical user, next N tokens */# define CALLSUBR '\031' /* call another rewriting set *//* conditionals in macros */# define CONDIF '\032' /* conditional if-then */# define CONDELSE '\033' /* conditional else */# define CONDFI '\034' /* conditional fi *//* bracket characters for host name lookup */# define HOSTBEGIN '\035' /* hostname lookup begin */# define HOSTEND '\036' /* hostname lookup end */# define MATCHYELLOW '\037' /* NIS map to match */# define MATCHNYELLOW '\017' /* NIS map to not match */# define YELLOWBEGIN '\016' /* start of a NIS replacement */# define YELLOWEND '\016' /* end of a NIS replacement *//* \001 is also reserved as the macro expansion character *//*** Information about hosts that we have looked up recently.**** This stuff is 4.2/3bsd specific.*/# ifdef DAEMON# ifdef VMUNIX# define HOSTINFO struct hostinfoHOSTINFO{ struct in_addr h_addrlist[MAXMXHOSTS+1]; /* Internet addresses */ u_short h_index; /* index into above */ u_short h_port; /* host port number */ unsigned char h_fd; /* File descriptor, if connected */ unsigned h_valid:1; /* 1=this entry has valid info */ unsigned h_exists:1; /* 1=host name/addr is known */ unsigned h_tried:1; /* 1=tried to connect */ unsigned h_down:1; /* 1=tried & failed connect */ unsigned h_open:1; /* 1=currently connected */ int h_errno; /* error on last connection */};/* * chache entry for mail exchanger information */struct mxinfo{ int mx_number; /* number of records */ int mx_rcode; /* remembered error code */ char *mx_hosts[MAXMXHOSTS+1]; /* names of exchangers */};/* * Cache entry for NIS lookup operations */struct bitmap2{ BITMAP positive, negative;};# define ENAMESER 999 /* name service time out */# endif VMUNIX# endif DAEMON/*** Symbol table definitions*/struct symtab{ char *s_name; /* name to be entered */ char s_type; /* general type (see below) */ struct symtab *s_next; /* pointer to next in chain */ union { BITMAP sv_class; /* bit-map of word classes */ ADDRESS *sv_addr; /* pointer to address header */ MAILER *sv_mailer; /* pointer to mailer */ char *sv_alias; /* alias */# ifdef HOSTINFO HOSTINFO sv_host; /* host information */ struct mxinfo sv_mxinfo; /* mail exchanger info */# endif HOSTINFO struct bitmap2 sv_bitmap2; /* NIS lookup cache */ } s_value;};typedef struct symtab STAB;/* symbol types */# define ST_UNDEF 0 /* undefined type */# define ST_CLASS 1 /* class map */# define ST_ADDRESS 2 /* an address in parsed format */# define ST_MAILER 3 /* a mailer header */# define ST_ALIAS 4 /* an alias */# define ST_HOST 5 /* host information */# define ST_MX 6 /* a mail exchanger list */# define ST_YP 7 /* NIS lookup */# define s_class s_value.sv_class# define s_address s_value.sv_addr# define s_mailer s_value.sv_mailer# define s_alias s_value.sv_aliasextern STAB *stab();/* opcodes to stab */# define ST_FIND 0 /* find entry */# define ST_ENTER 1 /* enter if not there *//*** STRUCT EVENT -- event queue.**** Maintained in sorted order.**** We store the pid of the process that set this event to insure** that when we fork we will not take events intended for the parent.*/struct event{ time_t ev_time; /* time of the function call */ int (*ev_func)(); /* function to call */ int ev_arg; /* argument to ev_func */ int ev_pid; /* pid that set this event */ struct event *ev_link; /* link to next item */};typedef struct event EVENT;EXTERN EVENT *EventQueue; /* head of event queue */struct metamac{ char metaname; char metaval;};extern struct metamac MetaMacros[];/*** Operation, send, and error modes**** The operation mode describes the basic operation of sendmail.** This can be set from the command line, and is "send mail" by** default.**** The send mode tells how to send mail. It can be set in the** configuration file. It's setting determines how quickly the** mail will be delivered versus the load on your system. If the** -v (verbose) flag is given, it will be forced to SM_DELIVER** mode.**** The error mode tells how to return errors.*/EXTERN char OpMode; /* operation mode, see below */#define MD_DELIVER 'm' /* be a mail sender */#define MD_ARPAFTP 'a' /* old-style arpanet protocols */#define MD_SMTP 's' /* run SMTP on standard input */#define MD_DAEMON 'd' /* run as a daemon */#define MD_VERIFY 'v' /* verify: don't collect or deliver */#define MD_TEST 't' /* test mode: resolve addrs only */#define MD_INITALIAS 'i' /* initialize alias database */#define MD_PRINT 'p' /* print the queue */#define MD_FREEZE 'z' /* freeze the configuration file */EXTERN char SendMode; /* send mode, see below */#define SM_DELIVER 'i' /* interactive delivery */#define SM_QUICKD 'j' /* deliver w/o queueing */#define SM_FORK 'b' /* deliver in background */#define SM_QUEUE 'q' /* queue, don't deliver */#define SM_VERIFY 'v' /* verify only (used internally) *//* used only as a parameter to sendall */#define SM_DEFAULT '\0' /* unspecified, use SendMode */EXTERN char ErrorMode; /* error mode, see below */#define EM_PRINT 'p' /* print errors */#define EM_MAIL 'm' /* mail back errors */#define EM_WRITE 'w' /* write back errors */#define EM_BERKNET 'e' /* special berknet processing */#define EM_QUIET 'q' /* don't print messages (stat only) *//* offset used to issure that the error messages for name server error * codes are unique. */#define MAX_ERRNO 100/*** Global variables.*/EXTERN bool FromFlag; /* if set, "From" person is explicit */EXTERN bool NoAlias; /* if set, don't do any aliasing */EXTERN bool ForceMail; /* if set, mail even if already got a copy */EXTERN bool MeToo; /* send to the sender also */EXTERN bool IgnrDot; /* don't let dot end messages */EXTERN bool SaveFrom; /* save leading "From" lines */EXTERN bool Verbose; /* set if blow-by-blow desired */EXTERN bool GrabTo; /* if set, get recipients from msg */EXTERN bool NoReturn; /* don't return letter to sender */EXTERN bool SuprErrs; /* set if we are suppressing errors */EXTERN bool QueueRun; /* currently running message from the queue */EXTERN bool HoldErrs; /* only output errors to transcript */EXTERN bool NoConnect; /* don't connect to non-local mailers */EXTERN bool SuperSafe; /* be extra careful, even if expensive */EXTERN bool ForkQueueRuns; /* fork for each job when running the queue */EXTERN bool AutoRebuild; /* auto-rebuild the alias database as needed */EXTERN bool CheckAliases; /* parse addresses during newaliases */EXTERN int SafeAlias; /* minutes to wait until @:@ in alias file */EXTERN time_t TimeOut; /* time until timeout */EXTERN FILE *InChannel; /* input connection */EXTERN FILE *OutChannel; /* output connection */EXTERN int RealUid; /* when Daemon, real uid of caller */EXTERN int RealGid; /* when Daemon, real gid of caller */EXTERN int DefUid; /* default uid to run as */EXTERN char *DefUser; /* default user to run as (from DefUid) */EXTERN int DefGid; /* default gid to run as */EXTERN int OldUmask; /* umask when sendmail starts up */EXTERN int Errors; /* set if errors (local to single pass) */EXTERN int ExitStat; /* exit status code */EXTERN int AliasLevel; /* depth of aliasing */EXTERN int MotherPid; /* proc id of parent process */EXTERN int LineNumber; /* line number in current input */EXTERN time_t ReadTimeout; /* timeout on reads */EXTERN int LogLevel; /* level of logging to perform */EXTERN int FileMode; /* mode on files */EXTERN int QueueLA; /* load average starting forced queueing */EXTERN int RefuseLA; /* load average refusing connections are */EXTERN int QueueFactor; /* slope of queue function */EXTERN time_t QueueIntvl; /* intervals between running the queue */EXTERN char *AliasFile; /* location of alias file */EXTERN char *HelpFile; /* location of SMTP help file */EXTERN char *StatFile; /* location of statistics summary */EXTERN char *QueueDir; /* location of queue directory */EXTERN char *FileName; /* name to print on error messages */EXTERN char *SmtpPhase; /* current phase in SMTP processing */EXTERN char *MyHostName; /* name of this host for SMTP messages */EXTERN char *RealHostName; /* name of host we are talking to */EXTERN char *CurHostName; /* current host we are dealing with */EXTERN jmp_buf TopFrame; /* branch-to-top-of-loop-on-error frame */EXTERN bool QuickAbort; /* .... but only if we want a quick abort */extern char *ConfFile; /* location of configuration file [conf.c] */extern char *FreezeFile; /* location of frozen memory image [conf.c] */extern char Arpa_Info[]; /* the reply code for Arpanet info [conf.c] */extern ADDRESS NullAddress; /* a null (template) address [main.c] */EXTERN char SpaceSub; /* substitution for <lwsp> */EXTERN int WkClassFact; /* multiplier for message class -> priority */EXTERN int WkRecipFact; /* multiplier for # of recipients -> priority */EXTERN int WkTimeFact; /* priority offset each time this job is run */EXTERN int CheckPointLimit; /* deliveries before checkpointing */EXTERN char *PostMasterCopy; /* address to get errs cc's */EXTERN char *TrustedUsers[MAXTRUST+1]; /* list of trusted users */EXTERN char *UserEnviron[MAXUSERENVIRON+1]; /* saved user environment */EXTERN char *RemoteServer; /* remote mail server name */EXTERN int RecipThreshold; /* minimum recipients to prohibit null msg */EXTERN int Maxhop; /* maximum number of hops (Received lines) *//*** Trace information*//* trace vector and macros for debugging flags */EXTERN u_char tTdvect[100];# define tTd(flag, level) (tTdvect[flag] >= level)# define tTdlevel(flag) (tTdvect[flag])/*** Miscellaneous information.*/# include <sysexits.h>/*** Some in-line functions*//* set exit status */#define setstat(s) { \ if (ExitStat == EX_OK || ExitStat == EX_TEMPFAIL) \ ExitStat = s; \ }/* make a copy of a string */#define newstr(s) strcpy(xalloc(strlen(s) + 1), s)#define STRUCTCOPY(s, d) d = s/*** Declarations of useful functions*/extern ADDRESS *parseaddr();extern char *xalloc();extern bool sameaddr();extern FILE *dfopen();extern EVENT *setevent();extern char *sfgets();extern char *queuename();extern time_t curtime();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -