📄 structs.h
字号:
/* $Cambridge: exim/exim-src/src/structs.h,v 1.15 2007/01/08 10:50:18 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
/* Copyright (c) University of Cambridge 1995 - 2007 */
/* See the file NOTICE for conditions of use and distribution. */
/* Definitions of various structures. In addition, those that are visible for
the compilation of local_scan() are defined in local_scan.h. These are
header_line
optionlist
recipient_item
For those declared here, we have to pre-declare some because of mutually
recursive definitions in the auths, routers, and transports blocks. */
struct address_item;
struct auth_info;
struct driver_info;
struct director_info;
struct smtp_inblock;
struct smtp_outblock;
struct transport_info;
struct router_info;
/* Structure for remembering macros for the configuration file */
typedef struct macro_item {
struct macro_item *next;
BOOL command_line;
uschar *replacement;
uschar name[1];
} macro_item;
/* Structure for bit tables for debugging and logging */
typedef struct bit_table {
uschar *name;
unsigned int bit;
} bit_table;
/* Block for holding a uid and gid, possibly unset, and an initgroups flag. */
typedef struct ugid_block {
uid_t uid;
gid_t gid;
BOOL uid_set;
BOOL gid_set;
BOOL initgroups;
} ugid_block;
/* Structure for holding information about a host for use mainly by routers,
but also used when checking lists of hosts and when transporting. Looking up
host addresses is done using this structure. */
typedef struct host_item {
struct host_item *next;
uschar *name; /* Host name */
uschar *address; /* IP address in text form */
int port; /* port value in host order (if SRV lookup) */
int mx; /* MX value if found via MX records */
int sort_key; /* MX*1000 plus random "fraction" */
int status; /* Usable, unusable, or unknown */
int why; /* Why host is unusable */
int last_try; /* Time of last try if known */
} host_item;
/* Chain of rewrite rules, read from the rewrite config, or parsed from the
rewrite_headers field of a transport. */
typedef struct rewrite_rule {
struct rewrite_rule *next;
int flags;
uschar *key;
uschar *replacement;
} rewrite_rule;
/* This structure is used to pass back configuration data from the smtp
transport to the outside world. It is used during callback processing. If ever
another remote transport were implemented, it could use the same structure. */
typedef struct transport_feedback {
uschar *interface;
uschar *port;
uschar *protocol;
uschar *hosts;
uschar *helo_data;
BOOL hosts_override;
BOOL hosts_randomize;
BOOL gethostbyname;
BOOL qualify_single;
BOOL search_parents;
} transport_feedback;
/* Routers, transports, and authenticators have similar data blocks. Each
driver that is compiled into the code is represented by a xxx_info block; the
active drivers are represented by a chain of xxx_instance blocks. To make it
possible to use the same code for reading the configuration files for all
three, the layout of the start of the blocks is kept the same, and represented
by the generic structures driver_info and driver_instance. */
typedef struct driver_instance {
struct driver_instance *next;
uschar *name; /* Instance name */
struct driver_info *info; /* Points to info for this driver */
void *options_block; /* Pointer to private options */
uschar *driver_name; /* All start with this generic option */
} driver_instance;
typedef struct driver_info {
uschar *driver_name; /* Name of driver */
optionlist *options; /* Table of private options names */
int *options_count; /* -> Number of entries in table */
void *options_block; /* Points to default private block */
int options_len; /* Length of same in bytes */
void (*init)( /* Initialization entry point */
struct driver_instance *);
} driver_info;
/* Structure for holding information about the configured transports. Some
of the generally accessible options are set from the configuration file; others
are set by transport initialization, since they can only be set for certain
transports. They need to be generally accessible, however, as they are used by
the main transport code. */
typedef struct transport_instance {
struct transport_instance *next;
uschar *name; /* Instance name */
struct transport_info *info; /* Info for this driver */
void *options_block; /* Pointer to private options */
uschar *driver_name; /* Must be first */
int (*setup)( /* Setup entry point */
struct transport_instance *,
struct address_item *,
struct transport_feedback *, /* For passing back config data */
uid_t, /* The uid that will be used */
gid_t, /* The gid that will be used */
uschar **); /* For an error message */
/**************************************/
int batch_max; /* ) */
uschar *batch_id; /* ) */
uschar *home_dir; /* ) Used only for local transports */
uschar *current_dir; /* ) */
/**************************************/
BOOL multi_domain; /* ) */
BOOL overrides_hosts; /* ) Used only for remote transports */
int max_addresses; /* ) */
int connection_max_messages;/* ) */
/**************************************/
BOOL deliver_as_creator; /* Used only by pipe at present */
BOOL disable_logging; /* For very weird requirements */
BOOL initgroups; /* Initialize groups when setting uid */
BOOL uid_set; /* uid is set */
BOOL gid_set; /* gid is set */
uid_t uid;
gid_t gid;
uschar *expand_uid; /* Variable uid */
uschar *expand_gid; /* Variable gid */
uschar *warn_message; /* Used only by appendfile at present */
uschar *shadow; /* Name of shadow transport */
uschar *shadow_condition; /* Condition for running it */
uschar *filter_command; /* For on-the-fly-filtering */
uschar *add_headers; /* Add these headers */
uschar *remove_headers; /* Remove these headers */
uschar *return_path; /* Overriding (rewriting) return path */
uschar *debug_string; /* Debugging output */
uschar *message_size_limit; /* Biggest message this transport handles */
uschar *headers_rewrite; /* Rules for rewriting headers */
rewrite_rule *rewrite_rules; /* Parsed rewriting rules */
int rewrite_existflags; /* Bits showing which headers are rewritten */
int filter_timeout; /* For transport filter timing */
BOOL body_only; /* Deliver only the body */
BOOL delivery_date_add; /* Add Delivery-Date header */
BOOL envelope_to_add; /* Add Envelope-To header */
BOOL headers_only; /* Deliver only the headers */
BOOL rcpt_include_affixes; /* TRUE to retain affixes in RCPT commands */
BOOL return_path_add; /* Add Return-Path header */
BOOL return_output; /* TRUE if output should always be returned */
BOOL return_fail_output; /* ditto, but only on failure */
BOOL log_output; /* Similarly for logging */
BOOL log_fail_output;
BOOL log_defer_output;
BOOL retry_use_local_part; /* Defaults true for local, false for remote */
} transport_instance;
/* Structure for holding information about a type of transport. The first six
fields must match driver_info above. */
typedef struct transport_info {
uschar *driver_name; /* Driver name */
optionlist *options; /* Table of private options names */
int *options_count; /* -> Number of entries in table */
void *options_block; /* Points to default private block */
int options_len; /* Length of same in bytes */
void (*init)( /* Initialization function */
struct transport_instance *);
/****/
BOOL (*code)( /* Main entry point */
transport_instance *,
struct address_item *);
void (*tidyup)( /* Tidyup function */
struct transport_instance *);
void (*closedown)( /* For closing down a passed channel */
struct transport_instance *);
BOOL local; /* TRUE for local transports */
} transport_info;
/* Structure for holding information about the configured routers. */
typedef struct router_instance {
struct router_instance *next;
uschar *name;
struct router_info *info;
void *options_block; /* Pointer to private options */
uschar *driver_name; /* Must be first */
uschar *address_data; /* Arbitrary data */
#ifdef EXPERIMENTAL_BRIGHTMAIL
uschar *bmi_rule; /* Brightmail AntiSpam rule checking */
#endif
uschar *cannot_route_message; /* Used when routing fails */
uschar *condition; /* General condition */
uschar *current_directory; /* For use during delivery */
uschar *debug_string; /* Debugging output */
uschar *domains; /* Specific domains */
uschar *errors_to; /* Errors address */
uschar *expand_gid; /* Expanded gid string */
uschar *expand_uid; /* Expanded uid string */
uschar *expand_more; /* Expanded more string */
uschar *expand_unseen; /* Expanded unseen string */
uschar *extra_headers; /* Additional headers */
uschar *fallback_hosts; /* For remote transports (text list) */
uschar *home_directory; /* For use during delivery */
uschar *ignore_target_hosts; /* Target hosts to ignore */
uschar *local_parts; /* Specific local parts */
uschar *pass_router_name; /* Router for passed address */
uschar *prefix; /* Address prefix */
uschar *redirect_router_name; /* Router for generated address */
uschar *remove_headers; /* Removed headers */
uschar *require_files; /* File checks before router is run */
uschar *router_home_directory; /* For use while routing */
uschar *self; /* Text option for handling self reference */
uschar *senders; /* Specific senders */
uschar *suffix; /* Address suffix */
uschar *translate_ip_address; /* IP address translation fudgery */
uschar *transport_name; /* Transport name */
BOOL address_test; /* Use this router when testing addresses */
#ifdef EXPERIMENTAL_BRIGHTMAIL
BOOL bmi_deliver_alternate; /* TRUE => BMI said that message should be delivered to alternate location */
BOOL bmi_deliver_default; /* TRUE => BMI said that message should be delivered to default location */
BOOL bmi_dont_deliver; /* TRUE => BMI said that message should not be delivered at all */
#endif
BOOL expn; /* Use this router when processing EXPN */
BOOL caseful_local_part; /* TRUE => don't lowercase */
BOOL check_local_user; /* TRUE => check local user */
BOOL disable_logging; /* For very weird requirements */
BOOL fail_verify_recipient; /* Fail verify if recipient match this router */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -