📄 sendmail.h
字号:
** in the Makefile.
**
** Vendors should apply to sendmail@sendmail.org for
** unique vendor codes.
*/
#define VENDOR_BERKELEY 1 /* Berkeley-native configuration file */
#define VENDOR_SUN 2 /* Sun-native configuration file */
#define VENDOR_HP 3 /* Hewlett-Packard specific config syntax */
#define VENDOR_IBM 4 /* IBM specific config syntax */
#define VENDOR_SENDMAIL 5 /* Sendmail, Inc. specific config syntax */
/* prototypes for vendor-specific hook routines */
extern void vendor_daemon_setup __P((ENVELOPE *));
extern void vendor_set_uid __P((UID_T));
/*
** Terminal escape codes.
**
** To make debugging output clearer.
*/
struct termescape
{
char *te_rv_on; /* turn reverse-video on */
char *te_rv_off; /* turn reverse-video off */
};
/*
** Additional definitions
*/
/* d_flags, see daemon.c */
/* general rule: lower case: required, upper case: No */
#define D_AUTHREQ 'a' /* authentication required */
#define D_BINDIF 'b' /* use if_addr for outgoing connection */
#define D_CANONREQ 'c' /* canonification required (cf) */
#define D_IFNHELO 'h' /* use if name for HELO */
#define D_FQMAIL 'f' /* fq sender address required (cf) */
#if _FFR_TLS_CLT1
#define D_CLTNOTLS 'S' /* don't use STARTTLS in client */
#endif /* _FFR_TLS_CLT1 */
#define D_FQRCPT 'r' /* fq recipient address required (cf) */
#define D_UNQUALOK 'u' /* unqualified address is ok (cf) */
#define D_NOCANON 'C' /* no canonification (cf) */
#define D_NOETRN 'E' /* no ETRN (MSA) */
#define D_ETRNONLY ((char)0x01) /* allow only ETRN (disk low) */
/* Flags for submitmode */
#define SUBMIT_UNKNOWN 0x0000 /* unknown agent type */
#define SUBMIT_MTA 0x0001 /* act like a message transfer agent */
#define SUBMIT_MSA 0x0002 /* act like a message submission agent */
#if SASL
/*
** SASL
*/
/* authenticated? */
# define SASL_NOT_AUTH 0 /* not authenticated */
# define SASL_PROC_AUTH 1 /* in process of authenticating */
# define SASL_IS_AUTH 2 /* authenticated */
/* SASL options */
# define SASL_AUTH_AUTH 0x1000 /* use auth= only if authenticated */
# if _FFR_SASL_OPTS
# define SASL_SEC_MASK 0x0fff /* mask for SASL_SEC_* values: sasl.h */
# if (SASL_SEC_NOPLAINTEXT & SASL_SEC_MASK) == 0 || \
(SASL_SEC_NOACTIVE & SASL_SEC_MASK) == 0 || \
(SASL_SEC_NODICTIONARY & SASL_SEC_MASK) == 0 || \
(SASL_SEC_FORWARD_SECRECY & SASL_SEC_MASK) == 0 || \
(SASL_SEC_NOANONYMOUS & SASL_SEC_MASK) == 0 || \
(SASL_SEC_PASS_CREDENTIALS & SASL_SEC_MASK) == 0
ERROR: change SASL_SEC_MASK_ notify sendmail.org!
# endif
# endif /* _FFR_SASL_OPTS */
# define MAXOUTLEN 1024 /* length of output buffer */
#endif /* SASL */
#if STARTTLS
/*
** TLS
*/
/* what to do in the TLS initialization */
#define TLS_I_NONE 0x00000000 /* no requirements... */
#define TLS_I_CERT_EX 0x00000001 /* CERT must exist */
#define TLS_I_CERT_UNR 0x00000002 /* CERT must be g/o unreadable */
#define TLS_I_KEY_EX 0x00000004 /* KEY must exist */
#define TLS_I_KEY_UNR 0x00000008 /* KEY must be g/o unreadable */
#define TLS_I_CERTP_EX 0x00000010 /* CA CERT PATH must exist */
#define TLS_I_CERTP_UNR 0x00000020 /* CA CERT PATH must be g/o unreadable */
#define TLS_I_CERTF_EX 0x00000040 /* CA CERT FILE must exist */
#define TLS_I_CERTF_UNR 0x00000080 /* CA CERT FILE must be g/o unreadable */
#define TLS_I_RSA_TMP 0x00000100 /* RSA TMP must be generated */
#define TLS_I_USE_KEY 0x00000200 /* private key must usable */
#define TLS_I_USE_CERT 0x00000400 /* certificate must be usable */
#define TLS_I_VRFY_PATH 0x00000800 /* load verify path must succeed */
#define TLS_I_VRFY_LOC 0x00001000 /* load verify default must succeed */
#define TLS_I_CACHE 0x00002000 /* require cache */
#define TLS_I_TRY_DH 0x00004000 /* try DH certificate */
#define TLS_I_REQ_DH 0x00008000 /* require DH certificate */
#define TLS_I_DHPAR_EX 0x00010000 /* require DH parameters */
#define TLS_I_DHPAR_UNR 0x00020000 /* DH param. must be g/o unreadable */
#define TLS_I_DH512 0x00040000 /* generate 512bit DH param */
#define TLS_I_DH1024 0x00080000 /* generate 1024bit DH param */
#define TLS_I_DH2048 0x00100000 /* generate 2048bit DH param */
/* server requirements */
#define TLS_I_SRV (TLS_I_CERT_EX | TLS_I_KEY_EX | TLS_I_KEY_UNR | \
TLS_I_CERTP_EX | TLS_I_CERTF_EX | TLS_I_RSA_TMP | \
TLS_I_USE_KEY | TLS_I_USE_CERT | TLS_I_VRFY_PATH | \
TLS_I_VRFY_LOC | TLS_I_TRY_DH | \
TLS_I_DH512)
/* client requirements */
#define TLS_I_CLT (TLS_I_KEY_UNR)
#define TLS_AUTH_OK 0
#define TLS_AUTH_NO 1
#define TLS_AUTH_FAIL (-1)
#endif /* STARTTLS */
/*
** Queue related items
*/
/* queue sort order */
#define QSO_BYPRIORITY 0 /* sort by message priority */
#define QSO_BYHOST 1 /* sort by first host name */
#define QSO_BYTIME 2 /* sort by submission time */
#define QSO_BYFILENAME 3 /* sort by file name only */
#if _FFR_QUEUEDELAY
#define QD_LINEAR 0 /* linear (old) delay alg */
#define QD_EXP 1 /* exponential delay alg */
#endif /* _FFR_QUEUEDELAY */
#define NOQDIR (-1) /* no queue directory (yet) */
#define NOW ((time_t) (-1)) /* queue return: now */
/* Queue Run Limitations */
struct queue_char
{
char *queue_match; /* string to match */
struct queue_char *queue_next;
};
typedef struct queue_char QUEUE_CHAR;
/* functions */
extern void assign_queueid __P((ENVELOPE *));
extern ADDRESS *copyqueue __P((ADDRESS *));
extern void initsys __P((ENVELOPE *));
extern void loseqfile __P((ENVELOPE *, char *));
extern void multiqueue_cache __P((void));
extern char *qid_printname __P((ENVELOPE *));
extern char *qid_printqueue __P((int));
extern char *queuename __P((ENVELOPE *, int));
extern void queueup __P((ENVELOPE *, bool));
extern bool runqueue __P((bool, bool));
extern void setnewqueue __P((ENVELOPE *));
extern bool shouldqueue __P((long, time_t));
extern void sync_queue_time __P((void));
/*
** Timeouts
**
** Indicated values are the MINIMUM per RFC 1123 section 5.3.2.
*/
EXTERN struct
{
/* RFC 1123-specified timeouts [minimum value] */
time_t to_initial; /* initial greeting timeout [5m] */
time_t to_mail; /* MAIL command [5m] */
time_t to_rcpt; /* RCPT command [5m] */
time_t to_datainit; /* DATA initiation [2m] */
time_t to_datablock; /* DATA block [3m] */
time_t to_datafinal; /* DATA completion [10m] */
time_t to_nextcommand; /* next command [5m] */
/* following timeouts are not mentioned in RFC 1123 */
time_t to_iconnect; /* initial connection timeout (first try) */
time_t to_connect; /* initial connection timeout (later tries) */
time_t to_rset; /* RSET command */
time_t to_helo; /* HELO command */
time_t to_quit; /* QUIT command */
time_t to_miscshort; /* misc short commands (NOOP, VERB, etc) */
time_t to_ident; /* IDENT protocol requests */
time_t to_fileopen; /* opening :include: and .forward files */
time_t to_control; /* process a control socket command */
/* following are per message */
time_t to_q_return[MAXTOCLASS]; /* queue return timeouts */
time_t to_q_warning[MAXTOCLASS]; /* queue warning timeouts */
time_t res_retrans[MAXRESTOTYPES]; /* resolver retransmit */
int res_retry[MAXRESTOTYPES]; /* resolver retry */
} TimeOuts;
/* timeout classes for return and warning timeouts */
#define TOC_NORMAL 0 /* normal delivery */
#define TOC_URGENT 1 /* urgent delivery */
#define TOC_NONURGENT 2 /* non-urgent delivery */
/* resolver timeout specifiers */
#define RES_TO_FIRST 0 /* first attempt */
#define RES_TO_NORMAL 1 /* subsequent attempts */
#define RES_TO_DEFAULT 2 /* default value */
/* functions */
extern void inittimeouts __P((char *, bool));
/*
** Trace information
*/
/* macros for debugging flags */
#define tTd(flag, level) (tTdvect[flag] >= (u_char)level)
#define tTdlevel(flag) (tTdvect[flag])
/* variables */
extern u_char tTdvect[100]; /* trace vector */
/*
** Miscellaneous information.
*/
/*
** The "no queue id" queue id for sm_syslog
*/
#define NOQID "*~*"
/*
** 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
/*
** Global variables.
*/
EXTERN bool AllowBogusHELO; /* allow syntax errors on HELO command */
#if !_FFR_REMOVE_AUTOREBUILD
EXTERN bool AutoRebuild; /* auto-rebuild the alias database as needed */
#endif /* !_FFR_REMOVE_AUTOREBUILD */
EXTERN bool CheckAliases; /* parse addresses during newaliases */
EXTERN bool ChownAlwaysSafe; /* treat chown(2) as safe */
EXTERN bool ColonOkInAddr; /* single colon legal in address */
EXTERN bool ConfigFileRead; /* configuration file has been read */
EXTERN bool DataProgress; /* have we sent anything since last check */
EXTERN bool DisConnected; /* running with OutChannel redirected to xf */
EXTERN bool DoQueueRun; /* non-interrupt time queue run needed */
EXTERN bool DontExpandCnames; /* do not $[...$] expand CNAMEs */
EXTERN bool DontInitGroups; /* avoid initgroups() because of NIS cost */
EXTERN bool DontLockReadFiles; /* don't read lock support files */
EXTERN bool DontProbeInterfaces; /* don't probe interfaces for names */
EXTERN bool DontPruneRoutes; /* don't prune source routes */
EXTERN bool ForkQueueRuns; /* fork for each job when running the queue */
EXTERN bool FromFlag; /* if set, "From" person is explicit */
EXTERN bool GrabTo; /* if set, get recipients from msg */
EXTERN bool HasEightBits; /* has at least one eight bit input byte */
EXTERN bool HasWildcardMX; /* don't use MX records when canonifying */
EXTERN bool HoldErrs; /* only output errors to transcript */
EXTERN bool IgnoreHostStatus; /* ignore long term host status files */
EXTERN bool IgnrDot; /* don't let dot end messages */
EXTERN bool InChild; /* true if running in an SMTP subprocess */
EXTERN bool LogUsrErrs; /* syslog user errors (e.g., SMTP RCPT cmd) */
EXTERN bool MapOpenErr; /* error opening a non-optional map */
EXTERN bool MatchGecos; /* look for user names in gecos field */
EXTERN bool MeToo; /* send to the sender also */
EXTERN bool NoAlias; /* suppress aliasing */
EXTERN bool NoConnect; /* don't connect to non-local mailers */
EXTERN bool OnlyOneError; /* .... or only want to give one SMTP reply */
EXTERN bool QuickAbort; /* .... but only if we want a quick abort */
EXTERN bool RrtImpliesDsn; /* turn Return-Receipt-To: into DSN */
EXTERN bool SaveFrom; /* save leading "From" lines */
EXTERN bool SendMIMEErrors; /* send error messages in MIME format */
EXTERN bool SevenBitInput; /* force 7-bit data on input */
EXTERN bool SingleLineFromHeader; /* force From: header to be one line */
EXTERN bool SingleThreadDelivery; /* single thread hosts on delivery */
EXTERN bool SuperSafe; /* be extra careful, even if expensive */
EXTERN bool SuprErrs; /* set if we are suppressing errors */
EXTERN bool TryNullMXList; /* if we are the best MX, try host directly */
EXTERN bool UseErrorsTo; /* use Errors-To: header (back compat) */
EXTERN bool UseHesiod; /* using Hesiod -- interpret Hesiod errors */
EXTERN bool UseNameServer; /* using DNS -- interpret h_errno & MX RRs */
EXTERN char InetMode; /* default network for daemon mode */
EXTERN char OpMode; /* operation mode, see below */
EXTERN char SpaceSub; /* substitution for <lwsp> */
EXTERN int CheckpointInterval; /* queue file checkpoint interval */
EXTERN int ConfigLevel; /* config file level */
EXTERN int ConnRateThrottle; /* throttle for SMTP connection rate */
EXTERN int CurChildren; /* current number of daemonic children */
EXTERN int CurrentLA; /* current load average */
EXTERN int DefaultNotify; /* default DSN notification flags */
EXTERN int Errors; /* set if errors (local to single pass) */
EXTERN int ExitStat; /* exit status code */
EXTERN int FileMode; /* mode on files */
EXTERN int LineNumber; /* line number in current input */
EXTERN int LogLevel; /* level of logging to perform */
EXTERN int MaxAliasRecursion; /* maximum depth of alias recursion */
EXTERN int MaxChildren; /* maximum number of daemonic children */
EXTERN int MaxForwardEntries; /* maximum number of forward entries */
EXTERN int MaxHeadersLength; /* max length of headers */
EXTERN int MaxHopCount; /* max # of hops until bounce */
EXTERN int MaxMacroRecursion; /* maximum depth of macro recursion */
EXTERN int MaxMciCache; /* maximum entries in MCI cache */
EXTERN int MaxMimeFieldLength; /* maximum MIME field length */
EXTERN int MaxMimeHeaderLength; /* maximum MIME header length */
EXTERN int MaxQueueRun; /* maximum number of jobs in one queue run */
EXTERN int MaxRcptPerMsg; /* max recipients per SMTP message */
EXTERN int MaxRuleRecursion; /* maximum depth of ruleset recursion */
EXTERN int MimeMode; /* MIME processing mode */
EXTERN int NoRecipientAction;
EXTERN int NumPriorities; /* pointer into Priorities */
EXTERN u_short PrivacyFlags; /* privacy flags */
#if _FFR_QUEUE_FILE_MODE
EXTERN int QueueFileMode; /* mode on qf/tf/df files */
#endif /* _FFR_QUEUE_FILE_MODE */
EXTERN int QueueLA; /* load average starting forced queueing */
EXTERN int QueueSortOrder; /* queue sorting order algorithm */
EXTERN int RefuseLA; /* load average refusing connections are */
EXTERN int VendorCode; /* vendor-specific operation enhancements */
EXTERN int Verbose; /* set if blow-by-blow desired */
EXTERN gid_t DefGid; /* default gid to run as */
EXTERN gid_t RealGid; /* real gid of caller */
EXTERN gid_t RunAsGid; /* GID to become for bulk of run */
EXTERN uid_t DefUid; /* default uid to run as */
EXTERN uid_t RealUid; /* real uid of caller */
EXTERN uid_t RunAsUid;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -