📄 sendmail.h
字号:
{ HDR *e_header; /* head of header list */ long e_msgpriority; /* adjusted priority of this message */ time_t e_ctime; /* time message appeared in the queue */ char *e_to; /* the target person */ char *e_receiptto; /* return receipt address */ ADDRESS e_from; /* the person it is from */ char *e_sender; /* e_from.q_paddr w comments stripped */ char **e_fromdomain; /* the domain part of the sender */ ADDRESS *e_sendqueue; /* list of message recipients */ ADDRESS *e_errorqueue; /* the queue for error responses */ long e_msgsize; /* size of the message in bytes */ long e_flags; /* flags, see below */ int e_nrcpts; /* number of recipients */ short e_class; /* msg class (priority, junk, etc.) */ short e_hopcount; /* number of times processed */ short e_nsent; /* number of sends since checkpoint */ short e_sendmode; /* message send mode */ short e_errormode; /* error return mode */ int (*e_puthdr)__P((MCI *, ENVELOPE *)); /* function to put header of message */ int (*e_putbody)__P((MCI *, ENVELOPE *, char *)); /* function to put body of message */ struct envelope *e_parent; /* the message this one encloses */ struct envelope *e_sibling; /* the next envelope of interest */ char *e_bodytype; /* type of message body */ char *e_df; /* location of temp file */ FILE *e_dfp; /* temporary file */ char *e_id; /* code for this entry in queue */ FILE *e_xfp; /* transcript file */ FILE *e_lockfp; /* the lock file for this message */ char *e_message; /* error message */ char *e_statmsg; /* stat msg (changes per delivery) */ char *e_msgboundary; /* MIME-style message part boundary */ char *e_origrcpt; /* original recipient (one only) */ char *e_macro[128]; /* macro definitions */};/* values for e_flags */#define EF_OLDSTYLE 0x0000001 /* use spaces (not commas) in hdrs */#define EF_INQUEUE 0x0000002 /* this message is fully queued */#define EF_CLRQUEUE 0x0000008 /* disk copy is no longer needed */#define EF_SENDRECEIPT 0x0000010 /* send a return receipt */#define EF_FATALERRS 0x0000020 /* fatal errors occured */#define EF_KEEPQUEUE 0x0000040 /* keep queue files always */#define EF_RESPONSE 0x0000080 /* this is an error or return receipt */#define EF_RESENT 0x0000100 /* this message is being forwarded */#define EF_VRFYONLY 0x0000200 /* verify only (don't expand aliases) */#define EF_WARNING 0x0000400 /* warning message has been sent */#define EF_QUEUERUN 0x0000800 /* this envelope is from queue */#define EF_GLOBALERRS 0x0001000 /* treat errors as global */#define EF_PM_NOTIFY 0x0002000 /* send return mail to postmaster */#define EF_METOO 0x0004000 /* send to me too */#define EF_LOGSENDER 0x0008000 /* need to log the sender */#define EF_NORECEIPT 0x0010000 /* suppress all return-receipts */EXTERN ENVELOPE *CurEnv; /* envelope currently being processed *//*** Message priority classes.**** The message class is read directly from the Priority: header** field in the message.**** CurEnv->e_msgpriority is the number of bytes in the message plus** the creation time (so that jobs ``tend'' to be ordered correctly),** adjusted by the message class, the number of recipients, and the** amount of time the message has been sitting around. This number** is used to order the queue. Higher values mean LOWER priority.**** Each priority class point is worth WkClassFact priority points;** each recipient is worth WkRecipFact priority points. Each time** we reprocess a message the priority is adjusted by WkTimeFact.** WkTimeFact should normally decrease the priority so that jobs** that have historically failed will be run later; thanks go to** Jay Lepreau at Utah for pointing out the error in my thinking.**** The "class" is this number, unadjusted by the age or size of** this message. Classes with negative representations will have** error messages thrown away if they are not local.*/struct priority{ char *pri_name; /* external name of priority */ int pri_val; /* internal value for same */};EXTERN struct priority Priorities[MAXPRIORITIES];EXTERN int NumPriorities; /* pointer into Priorities *//*** Rewrite rules.*/struct rewrite{ char **r_lhs; /* pattern match */ char **r_rhs; /* substitution value */ struct rewrite *r_next;/* next in chain */};EXTERN struct rewrite *RewriteRules[MAXRWSETS];/*** Special characters in rewriting rules.** 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 0220 /* match zero or more tokens */# define MATCHANY 0221 /* match one or more tokens */# define MATCHONE 0222 /* match exactly one token */# define MATCHCLASS 0223 /* match one token in a class */# define MATCHNCLASS 0224 /* match anything not in class */# define MATCHREPL 0225 /* replacement on RHS for above *//* right hand side items */# define CANONNET 0226 /* canonical net, next token */# define CANONHOST 0227 /* canonical host, next token */# define CANONUSER 0230 /* canonical user, next N tokens */# define CALLSUBR 0231 /* call another rewriting set *//* conditionals in macros */# define CONDIF 0232 /* conditional if-then */# define CONDELSE 0233 /* conditional else */# define CONDFI 0234 /* conditional fi *//* bracket characters for host name lookup */# define HOSTBEGIN 0235 /* hostname lookup begin */# define HOSTEND 0236 /* hostname lookup end *//* bracket characters for generalized lookup */# define LOOKUPBEGIN 0205 /* generalized lookup begin */# define LOOKUPEND 0206 /* generalized lookup end *//* macro substitution character */# define MACROEXPAND 0201 /* macro expansion */# define MACRODEXPAND 0202 /* deferred macro expansion *//* to make the code clearer */# define MATCHZERO CANONHOST/* external <==> internal mapping table */struct metamac{ char metaname; /* external code (after $) */ u_char metaval; /* internal code (as above) */};/*** Name canonification short circuit.**** If the name server for a host is down, the process of trying to** canonify the name can hang. This is similar to (but alas, not** identical to) looking up the name for delivery. This stab type** caches the result of the name server lookup so we don't hang** multiple times.*/#define NAMECANON struct _namecanonNAMECANON{ short nc_errno; /* cached errno */ short nc_herrno; /* cached h_errno */ short nc_stat; /* cached exit status code */ short nc_flags; /* flag bits */ char *nc_cname; /* the canonical name */};/* values for nc_flags */#define NCF_VALID 0x0001 /* entry valid *//*** Mapping functions**** These allow arbitrary mappings in the config file. The idea** (albeit not the implementation) comes from IDA sendmail.*/# define MAPCLASS struct _mapclass# define MAP struct _map/*** An actual map.*/MAP{ MAPCLASS *map_class; /* the class of this map */ char *map_mname; /* name of this map */ int map_mflags; /* flags, see below */ char *map_file; /* the (nominal) filename */ ARBPTR_T map_db1; /* the open database ptr */ ARBPTR_T map_db2; /* an "extra" database pointer */ char *map_app; /* to append to successful matches */ char *map_domain; /* the (nominal) NIS domain */ char *map_rebuild; /* program to run to do auto-rebuild */ time_t map_mtime; /* last database modification time */};/* bit values for map_flags */# define MF_VALID 0x0001 /* this entry is valid */# define MF_INCLNULL 0x0002 /* include null byte in key */# define MF_OPTIONAL 0x0004 /* don't complain if map not found */# define MF_NOFOLDCASE 0x0008 /* don't fold case in keys */# define MF_MATCHONLY 0x0010 /* don't use the map value */# define MF_OPEN 0x0020 /* this entry is open */# define MF_WRITABLE 0x0040 /* open for writing */# define MF_ALIAS 0x0080 /* this is an alias file */# define MF_TRY0NULL 0x0100 /* try with no null byte */# define MF_TRY1NULL 0x0200 /* try with the null byte */# define MF_LOCKED 0x0400 /* this map is currently locked */# define MF_ALIASWAIT 0x0800 /* alias map in aliaswait state */# define MF_IMPL_HASH 0x1000 /* implicit: underlying hash database */# define MF_IMPL_NDBM 0x2000 /* implicit: underlying NDBM database *//*** The class of a map -- essentially the functions to call*/MAPCLASS{ char *map_cname; /* name of this map class */ char *map_ext; /* extension for database file */ short map_cflags; /* flag bits, see below */ bool (*map_parse)__P((MAP *, char *)); /* argument parsing function */ char *(*map_lookup)__P((MAP *, char *, char **, int *)); /* lookup function */ void (*map_store)__P((MAP *, char *, char *)); /* store function */ bool (*map_open)__P((MAP *, int)); /* open function */ void (*map_close)__P((MAP *)); /* close function */};/* bit values for map_cflags */#define MCF_ALIASOK 0x0001 /* can be used for aliases */#define MCF_ALIASONLY 0x0002 /* usable only for aliases */#define MCF_REBUILDABLE 0x0004 /* can rebuild alias files *//*** 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 */ MAPCLASS sv_mapclass; /* mapping function class */ MAP sv_map; /* mapping function */ char *sv_hostsig; /* host signature */ MCI sv_mci; /* mailer connection info */ NAMECANON sv_namecanon; /* canonical name 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_MAPCLASS 5 /* mapping function class */# define ST_MAP 6 /* mapping function */# define ST_HOSTSIG 7 /* host signature */# define ST_NAMECANON 8 /* cached canonical name */# define ST_MCI 16 /* mailer connection info (offset) */# 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_alias# define s_mci s_value.sv_mci# define s_mapclass s_value.sv_mapclass# define s_hostsig s_value.sv_hostsig# define s_map s_value.sv_map# define s_namecanon s_value.sv_namecanonextern STAB *stab __P((char *, int, int));extern void stabapply __P((void (*)(STAB *, int), int));/* 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)__P((int)); /* 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 *//*** 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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -