⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendmail.h

📁 < linux网络编程工具>>配套源码
💻 H
📖 第 1 页 / 共 5 页
字号:
**	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 */
};

/*
**  Rewrite rules.
*/

struct rewrite
{
	char	**r_lhs;	/* pattern match */
	char	**r_rhs;	/* substitution value */
	struct rewrite	*r_next;/* next in chain */
	int	r_line;		/* rule line in sendmail.cf */
};

/*
**  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	((u_char)0220)	/* match zero or more tokens */
#define MATCHANY	((u_char)0221)	/* match one or more tokens */
#define MATCHONE	((u_char)0222)	/* match exactly one token */
#define MATCHCLASS	((u_char)0223)	/* match one token in a class */
#define MATCHNCLASS	((u_char)0224)	/* match anything not in class */
#define MATCHREPL	((u_char)0225)	/* replacement on RHS for above */

/* right hand side items */
#define CANONNET	((u_char)0226)	/* canonical net, next token */
#define CANONHOST	((u_char)0227)	/* canonical host, next token */
#define CANONUSER	((u_char)0230)	/* canonical user, next N tokens */
#define CALLSUBR	((u_char)0231)	/* call another rewriting set */

/* conditionals in macros */
#define CONDIF		((u_char)0232)	/* conditional if-then */
#define CONDELSE	((u_char)0233)	/* conditional else */
#define CONDFI		((u_char)0234)	/* conditional fi */

/* bracket characters for host name lookup */
#define HOSTBEGIN	((u_char)0235)	/* hostname lookup begin */
#define HOSTEND	((u_char)0236)	/* hostname lookup end */

/* bracket characters for generalized lookup */
#define LOOKUPBEGIN	((u_char)0205)	/* generalized lookup begin */
#define LOOKUPEND	((u_char)0206)	/* generalized lookup end */

/* macro substitution character */
#define MACROEXPAND	((u_char)0201)	/* macro expansion */
#define MACRODEXPAND	((u_char)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) */
};

/* values for macros with external names only */
#define MID_OPMODE	0202	/* operation mode */

/* functions */
extern void	define __P((int, char *, ENVELOPE *));
extern void	expand __P((char *, char *, size_t, ENVELOPE *));
extern int	macid __P((char *, char **));
extern char	*macname __P((int));
extern char	*macvalue __P((int, ENVELOPE *));
extern int	rscheck __P((char *, char *, char *, ENVELOPE *, bool, bool, int));
extern void	setclass __P((int, char *));
extern int	strtorwset __P((char *, char **, int));
extern void	translate_dollars __P((char *));
extern bool	wordinclass __P((char *, int));

/*
**  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 _namecanon

NAMECANON
{
	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 */

/* functions */
extern bool	getcanonname __P((char *, int, bool));
extern int	getmxrr __P((char *, char **, u_short *, bool, int *));

/*
**  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
#define MAXMAPACTIONS	5		/* size of map_actions array */


/*
**  An actual map.
*/

MAP
{
	MAPCLASS	*map_class;	/* the class of this map */
	char		*map_mname;	/* name of this map */
	long		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_keycolnm;	/* key column name */
	char		*map_valcolnm;	/* value column name */
	u_char		map_keycolno;	/* key column number */
	u_char		map_valcolno;	/* value column number */
	char		map_coldelim;	/* column delimiter */
	char		map_spacesub;	/* spacesub */
	char		*map_app;	/* to append to successful matches */
	char		*map_tapp;	/* to append to "tempfail" 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 */
	pid_t		map_pid;	/* PID of process which opened map */
	int		map_lockfd;	/* auxiliary lock file descriptor */
	short		map_specificity;	/* specificity of aliases */
	MAP		*map_stack[MAXMAPSTACK];   /* list for stacked maps */
	short		map_return[MAXMAPACTIONS]; /* return bitmaps for stacked maps */
};


/* bit values for map_mflags */
#define MF_VALID	0x00000001	/* this entry is valid */
#define MF_INCLNULL	0x00000002	/* include null byte in key */
#define MF_OPTIONAL	0x00000004	/* don't complain if map not found */
#define MF_NOFOLDCASE	0x00000008	/* don't fold case in keys */
#define MF_MATCHONLY	0x00000010	/* don't use the map value */
#define MF_OPEN		0x00000020	/* this entry is open */
#define MF_WRITABLE	0x00000040	/* open for writing */
#define MF_ALIAS	0x00000080	/* this is an alias file */
#define MF_TRY0NULL	0x00000100	/* try with no null byte */
#define MF_TRY1NULL	0x00000200	/* try with the null byte */
#define MF_LOCKED	0x00000400	/* this map is currently locked */
#define MF_ALIASWAIT	0x00000800	/* alias map in aliaswait state */
#define MF_IMPL_HASH	0x00001000	/* implicit: underlying hash database */
#define MF_IMPL_NDBM	0x00002000	/* implicit: underlying NDBM database */
#define MF_UNSAFEDB	0x00004000	/* this map is world writable */
#define MF_APPEND	0x00008000	/* append new entry on rebuild */
#define MF_KEEPQUOTES	0x00010000	/* don't dequote key before lookup */
#define MF_NODEFER	0x00020000	/* don't defer if map lookup fails */
#define MF_REGEX_NOT	0x00040000	/* regular expression negation */
#define MF_DEFER	0x00080000	/* don't lookup map in defer mode */
#define MF_SINGLEMATCH	0x00100000	/* successful only if match one key */
#define MF_NOREWRITE	0x00200000	/* don't rewrite result, return as-is */

#define DYNOPENMAP(map) if (!bitset(MF_OPEN, (map)->map_mflags)) \
	{	\
		if (!openmap(map))	\
			return NULL;	\
	}


/* indices for map_actions */
#define MA_NOTFOUND	0		/* member map returned "not found" */
#define MA_UNAVAIL	1		/* member map is not available */
#define MA_TRYAGAIN	2		/* member map returns temp failure */

/*
**  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 */
#define MCF_OPTFILE	0x0008		/* file name is optional */

/* functions */
extern void	closemaps __P((void));
extern bool	impl_map_open __P((MAP *, int));
extern void	initmaps __P((void));
extern MAP	*makemapentry __P((char *));
extern void	maplocaluser __P((ADDRESS *, ADDRESS **, int, ENVELOPE *));
extern char	*map_rewrite __P((MAP *, const char *, size_t, char **));
#if NETINFO
extern char	*ni_propval __P((char *, char *, char *, char *, int));
#endif /* NETINFO */
extern bool	openmap __P((MAP *));
#if USERDB
extern void	_udbx_close __P((void));
extern int	udbexpand __P((ADDRESS *, ADDRESS **, int, ENVELOPE *));
extern char	*udbsender __P((char *));
#endif /* USERDB */
/*
**  LDAP related items
*/
#ifdef LDAPMAP
struct ldapmap_struct
{
	/* needed for ldap_open or ldap_init */
	char		*ldap_host;
	int		ldap_port;

	/* options set in ld struct before ldap_bind_s */
	int		ldap_deref;
	time_t		ldap_timelimit;
	int		ldap_sizelimit;
	int		ldap_options;

	/* args for ldap_bind_s */
	LDAP		*ldap_ld;
	char		*ldap_binddn;
	char		*ldap_secret;
	int		ldap_method;

	/* args for ldap_search */
	char		*ldap_base;
	int		ldap_scope;
	char		*ldap_filter;
	char		*ldap_attr[LDAPMAP_MAX_ATTR + 1];
	bool		ldap_attrsonly;

	/* args for ldap_result */
	struct timeval	ldap_timeout;
	LDAPMessage	*ldap_res;
};

typedef struct ldapmap_struct	LDAPMAP_STRUCT;

/* struct defining LDAP Auth Methods */
struct lamvalues
{
	char	*lam_name;	/* name of LDAP auth method */
	int	lam_code;	/* numeric code */
};

/* struct defining LDAP Alias Dereferencing */
struct ladvalues
{
	char	*lad_name;	/* name of LDAP alias dereferencing method */
	int	lad_code;	/* numeric code */
};

/* struct defining LDAP Search Scope */
struct lssvalues
{
	char	*lss_name;	/* name of LDAP search scope */
	int	lss_code;	/* numeric code */
};

/* functions */
extern bool	ldapmap_parseargs __P((MAP *, char *));
extern void	ldapmap_set_defaults __P((char *));
#endif /* LDAPMAP */

/*
**  PH related items
*/

#ifdef PH_MAP
struct ph_map_struct
{
	char	*ph_servers;	/* list of ph servers */
	char	*ph_field_list;	/* list of fields to search for match */
	FILE	*ph_to_server;
	FILE	*ph_from_server;
	int	ph_sockfd;
	time_t	ph_timeout;
};
typedef struct ph_map_struct	PH_MAP_STRUCT;

# define DEFAULT_PH_MAP_FIELDS		"alias callsign name spacedname"
#endif /* PH_MAP */
/*
**  Process List (proclist)
*/

struct procs
{
	pid_t	proc_pid;
	char	*proc_task;
	int	proc_type;
};

#define NO_PID		((pid_t) 0)
#ifndef PROC_LIST_SEG
# define PROC_LIST_SEG	32		/* number of pids to alloc at a time */
#endif /* ! PROC_LIST_SEG */

/* process types */
#define PROC_NONE		0
#define PROC_DAEMON		1
#define PROC_DAEMON_CHILD	2
#define PROC_QUEUE		3
#define PROC_QUEUE_CHILD	3
#define PROC_CONTROL		4
#define PROC_CONTROL_CHILD	5

/* functions */
extern void	proc_list_add __P((pid_t, char *, int));
extern void	proc_list_clear __P((void));
extern void	proc_list_display __P((FILE *));
extern int	proc_list_drop __P((pid_t));
extern void	proc_list_probe __P((void));
extern void	proc_list_set __P((pid_t, char *));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -