1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 1995 - 2015 */
6 /* See the file NOTICE for conditions of use and distribution. */
9 /* Definitions of various structures. In addition, those that are visible for
10 the compilation of local_scan() are defined in local_scan.h. These are
16 For those declared here, we have to pre-declare some because of mutually
17 recursive definitions in the auths, routers, and transports blocks. */
25 struct transport_info;
28 /* Structure for remembering macros for the configuration file */
30 typedef struct macro_item {
31 struct macro_item *next;
37 /* Structure for bit tables for debugging and logging */
39 typedef struct bit_table {
44 /* Block for holding a uid and gid, possibly unset, and an initgroups flag. */
46 typedef struct ugid_block {
54 typedef enum {CHUNKING_NOT_OFFERED, CHUNKING_OFFERED, CHUNKING_ACTIVE, CHUNKING_LAST} chunking_state_t;
56 /* Structure for holding information about a host for use mainly by routers,
57 but also used when checking lists of hosts and when transporting. Looking up
58 host addresses is done using this structure. */
60 typedef enum {DS_UNK=-1, DS_NO, DS_YES} dnssec_status_t;
62 typedef struct host_item {
63 struct host_item *next;
64 const uschar *name; /* Host name */
65 const uschar *address; /* IP address in text form */
66 int port; /* port value in host order (if SRV lookup) */
67 int mx; /* MX value if found via MX records */
68 int sort_key; /* MX*1000 plus random "fraction" */
69 int status; /* Usable, unusable, or unknown */
70 int why; /* Why host is unusable */
71 int last_try; /* Time of last try if known */
72 dnssec_status_t dnssec;
75 /* Chain of rewrite rules, read from the rewrite config, or parsed from the
76 rewrite_headers field of a transport. */
78 typedef struct rewrite_rule {
79 struct rewrite_rule *next;
85 /* This structure is used to pass back configuration data from the smtp
86 transport to the outside world. It is used during callback processing. If ever
87 another remote transport were implemented, it could use the same structure. */
89 typedef struct transport_feedback {
100 } transport_feedback;
102 /* Routers, transports, and authenticators have similar data blocks. Each
103 driver that is compiled into the code is represented by a xxx_info block; the
104 active drivers are represented by a chain of xxx_instance blocks. To make it
105 possible to use the same code for reading the configuration files for all
106 three, the layout of the start of the blocks is kept the same, and represented
107 by the generic structures driver_info and driver_instance. */
109 typedef struct driver_instance {
110 struct driver_instance *next;
111 uschar *name; /* Instance name */
112 struct driver_info *info; /* Points to info for this driver */
113 void *options_block; /* Pointer to private options */
114 uschar *driver_name; /* All start with this generic option */
117 typedef struct driver_info {
118 uschar *driver_name; /* Name of driver */
119 optionlist *options; /* Table of private options names */
120 int *options_count; /* -> Number of entries in table */
121 void *options_block; /* Points to default private block */
122 int options_len; /* Length of same in bytes */
123 void (*init)( /* Initialization entry point */
124 struct driver_instance *);
128 /* Structure for holding information about the configured transports. Some
129 of the generally accessible options are set from the configuration file; others
130 are set by transport initialization, since they can only be set for certain
131 transports. They need to be generally accessible, however, as they are used by
132 the main transport code. */
134 typedef struct transport_instance {
135 struct transport_instance *next;
136 uschar *name; /* Instance name */
137 struct transport_info *info; /* Info for this driver */
138 void *options_block; /* Pointer to private options */
139 uschar *driver_name; /* Must be first */
140 int (*setup)( /* Setup entry point */
141 struct transport_instance *,
142 struct address_item *,
143 struct transport_feedback *, /* For passing back config data */
144 uid_t, /* The uid that will be used */
145 gid_t, /* The gid that will be used */
146 uschar **); /* For an error message */
147 /**************************************/
148 int batch_max; /* ) */
149 uschar *batch_id; /* ) */
150 uschar *home_dir; /* ) Used only for local transports */
151 uschar *current_dir; /* ) */
152 /**************************************/
153 uschar *expand_multi_domain; /* ) */
154 BOOL multi_domain; /* ) */
155 BOOL overrides_hosts; /* ) Used only for remote transports */
156 int max_addresses; /* ) */
157 int connection_max_messages;/* ) */
158 /**************************************/
159 BOOL deliver_as_creator; /* Used only by pipe at present */
160 BOOL disable_logging; /* For very weird requirements */
161 BOOL initgroups; /* Initialize groups when setting uid */
162 BOOL uid_set; /* uid is set */
163 BOOL gid_set; /* gid is set */
166 uschar *expand_uid; /* Variable uid */
167 uschar *expand_gid; /* Variable gid */
168 uschar *warn_message; /* Used only by appendfile at present */
169 uschar *shadow; /* Name of shadow transport */
170 uschar *shadow_condition; /* Condition for running it */
171 uschar *filter_command; /* For on-the-fly-filtering */
172 uschar *add_headers; /* Add these headers */
173 uschar *remove_headers; /* Remove these headers */
174 uschar *return_path; /* Overriding (rewriting) return path */
175 uschar *debug_string; /* Debugging output */
176 uschar *max_parallel; /* Number of concurrent instances */
177 uschar *message_size_limit; /* Biggest message this transport handles */
178 uschar *headers_rewrite; /* Rules for rewriting headers */
179 rewrite_rule *rewrite_rules; /* Parsed rewriting rules */
180 int rewrite_existflags; /* Bits showing which headers are rewritten */
181 int filter_timeout; /* For transport filter timing */
182 BOOL body_only; /* Deliver only the body */
183 BOOL delivery_date_add; /* Add Delivery-Date header */
184 BOOL envelope_to_add; /* Add Envelope-To header */
185 BOOL headers_only; /* Deliver only the headers */
186 BOOL rcpt_include_affixes; /* TRUE to retain affixes in RCPT commands */
187 BOOL return_path_add; /* Add Return-Path header */
188 BOOL return_output; /* TRUE if output should always be returned */
189 BOOL return_fail_output; /* ditto, but only on failure */
190 BOOL log_output; /* Similarly for logging */
191 BOOL log_fail_output;
192 BOOL log_defer_output;
193 BOOL retry_use_local_part; /* Defaults true for local, false for remote */
194 #ifndef DISABLE_EVENT
195 uschar *event_action; /* String to expand on notable events */
197 } transport_instance;
200 /* Structure for holding information about a type of transport. The first six
201 fields must match driver_info above. */
203 typedef struct transport_info {
204 uschar *driver_name; /* Driver name */
205 optionlist *options; /* Table of private options names */
206 int *options_count; /* -> Number of entries in table */
207 void *options_block; /* Points to default private block */
208 int options_len; /* Length of same in bytes */
209 void (*init)( /* Initialization function */
210 struct transport_instance *);
212 BOOL (*code)( /* Main entry point */
213 transport_instance *,
214 struct address_item *);
215 void (*tidyup)( /* Tidyup function */
216 struct transport_instance *);
217 void (*closedown)( /* For closing down a passed channel */
218 struct transport_instance *);
219 BOOL local; /* TRUE for local transports */
229 /* Structure for holding information about the configured routers. */
231 typedef struct router_instance {
232 struct router_instance *next;
234 struct router_info *info;
235 void *options_block; /* Pointer to private options */
236 uschar *driver_name; /* Must be first */
238 uschar *address_data; /* Arbitrary data */
239 #ifdef EXPERIMENTAL_BRIGHTMAIL
240 uschar *bmi_rule; /* Brightmail AntiSpam rule checking */
242 uschar *cannot_route_message; /* Used when routing fails */
243 uschar *condition; /* General condition */
244 uschar *current_directory; /* For use during delivery */
245 uschar *debug_string; /* Debugging output */
246 uschar *domains; /* Specific domains */
247 uschar *errors_to; /* Errors address */
248 uschar *expand_gid; /* Expanded gid string */
249 uschar *expand_uid; /* Expanded uid string */
250 uschar *expand_more; /* Expanded more string */
251 uschar *expand_unseen; /* Expanded unseen string */
252 uschar *extra_headers; /* Additional headers */
253 uschar *fallback_hosts; /* For remote transports (text list) */
254 uschar *home_directory; /* For use during delivery */
255 uschar *ignore_target_hosts; /* Target hosts to ignore */
256 uschar *local_parts; /* Specific local parts */
257 uschar *pass_router_name; /* Router for passed address */
258 uschar *prefix; /* Address prefix */
259 uschar *redirect_router_name; /* Router for generated address */
260 uschar *remove_headers; /* Removed headers */
261 uschar *require_files; /* File checks before router is run */
262 uschar *router_home_directory; /* For use while routing */
263 uschar *self; /* Text option for handling self reference */
264 uschar *senders; /* Specific senders */
265 uschar *suffix; /* Address suffix */
266 uschar *translate_ip_address; /* IP address translation fudgery */
267 uschar *transport_name; /* Transport name */
269 BOOL address_test; /* Use this router when testing addresses */
270 #ifdef EXPERIMENTAL_BRIGHTMAIL
271 BOOL bmi_deliver_alternate; /* TRUE => BMI said that message should be delivered to alternate location */
272 BOOL bmi_deliver_default; /* TRUE => BMI said that message should be delivered to default location */
273 BOOL bmi_dont_deliver; /* TRUE => BMI said that message should not be delivered at all */
275 BOOL expn; /* Use this router when processing EXPN */
276 BOOL caseful_local_part; /* TRUE => don't lowercase */
277 BOOL check_local_user; /* TRUE => check local user */
278 BOOL disable_logging; /* For very weird requirements */
279 BOOL fail_verify_recipient; /* Fail verify if recipient match this router */
280 BOOL fail_verify_sender; /* Fail verify if sender match this router */
281 BOOL gid_set; /* Flag to indicate gid is set */
282 BOOL initgroups; /* TRUE if initgroups is required */
283 BOOL log_as_local; /* TRUE logs as a local delivery */
284 BOOL more; /* If FALSE, do no more if this one fails */
285 BOOL pass_on_timeout; /* Treat timeout DEFERs as fails */
286 BOOL prefix_optional; /* Just what it says */
287 BOOL repeat_use; /* If FALSE, skip if ancestor used it */
288 BOOL retry_use_local_part; /* Just what it says */
289 BOOL same_domain_copy_routing; /* TRUE => copy routing for same domain */
290 BOOL self_rewrite; /* TRUE to rewrite headers if making local */
291 BOOL suffix_optional; /* As it says */
292 BOOL verify_only; /* Skip this router if not verifying */
293 BOOL verify_recipient; /* Use this router when verifying a recipient*/
294 BOOL verify_sender; /* Use this router when verifying a sender */
295 BOOL uid_set; /* Flag to indicate uid is set */
296 BOOL unseen; /* If TRUE carry on, even after success */
297 BOOL dsn_lasthop; /* If TRUE, this router is a DSN endpoint */
299 int self_code; /* Encoded version of "self" */
300 uid_t uid; /* Fixed uid value */
301 gid_t gid; /* Fixed gid value */
303 host_item *fallback_hostlist; /* For remote transport (block chain) */
304 transport_instance *transport; /* Transport block (when found) */
305 struct router_instance *pass_router; /* Actual router for passed address */
306 struct router_instance *redirect_router; /* Actual router for generated address */
308 dnssec_domains dnssec;
312 /* Structure for holding information about a type of router. The first six
313 fields must match driver_info above. */
315 typedef struct router_info {
317 optionlist *options; /* Table of private options names */
318 int *options_count; /* -> Number of entries in table */
319 void *options_block; /* Points to default private block */
320 int options_len; /* Length of same in bytes */
321 void (*init)( /* Initialization function */
322 struct router_instance *);
324 int (*code)( /* Main entry point */
326 struct address_item *,
329 struct address_item **,
330 struct address_item **,
331 struct address_item **,
332 struct address_item **);
333 void (*tidyup)( /* Tidyup function */
334 struct router_instance *);
335 int ri_flags; /* Descriptive flags */
339 /* Structure for holding information about a lookup type. */
341 #include "lookupapi.h"
344 /* Structure for holding information about the configured authentication
347 typedef struct auth_instance {
348 struct auth_instance *next;
349 uschar *name; /* Exim instance name */
350 struct auth_info *info; /* Pointer to driver info block */
351 void *options_block; /* Pointer to private options */
352 uschar *driver_name; /* Must be first */
353 uschar *advertise_condition; /* Are we going to advertise this?*/
354 uschar *client_condition; /* Should the client try this? */
355 uschar *public_name; /* Advertised name */
356 uschar *set_id; /* String to set when server as authenticated id */
357 uschar *set_client_id; /* String to set when client as client_authenticated id */
358 uschar *mail_auth_condition; /* Condition for AUTH on MAIL command */
359 uschar *server_debug_string; /* Debugging output */
360 uschar *server_condition; /* Authorization condition */
361 BOOL client; /* TRUE if client option(s) set */
362 BOOL server; /* TRUE if server options(s) set */
363 BOOL advertised; /* Set TRUE when advertised */
367 /* Structure for holding information about an authentication mechanism. The
368 first six fields must match driver_info above. */
370 typedef struct auth_info {
371 uschar *driver_name; /* e.g. "condition" */
372 optionlist *options; /* Table of private options names */
373 int *options_count; /* -> Number of entries in table */
374 void *options_block; /* Points to default private block */
375 int options_len; /* Length of same in bytes */
376 void (*init)( /* initialization function */
377 struct auth_instance *);
379 int (*servercode)( /* server function */
380 auth_instance *, /* the instance data */
381 uschar *); /* rest of AUTH command */
382 int (*clientcode)( /* client function */
383 struct auth_instance *,
384 struct smtp_inblock *, /* socket and input buffer */
385 struct smtp_outblock *, /* socket and output buffer */
386 int, /* command timeout */
387 uschar *, /* buffer for reading response */
388 int); /* sizeof buffer */
389 void (*version_report)( /* diagnostic version reporting */
390 FILE *); /* I/O stream to print to */
394 /* Structure for holding a single IP address and port; used for the chain of
395 addresses and ports for the local host. Make the char string large enough to
396 hold an IPv6 address. */
398 typedef struct ip_address_item {
399 struct ip_address_item *next;
401 BOOL v6_include_v4; /* Used in the daemon */
405 /* Structure for chaining together arbitrary strings. */
407 typedef struct string_item {
408 struct string_item *next;
412 /* Information about a soft delivery failure, for use when calculating
413 retry information. It's separate from the address block, because there
414 can be a chain of them for SMTP deliveries where multiple IP addresses
417 typedef struct retry_item {
418 struct retry_item *next; /* for chaining */
419 uschar *key; /* string identifying host/address/message */
420 int basic_errno; /* error code for this destination */
421 int more_errno; /* additional error information */
422 uschar *message; /* local error message */
423 int flags; /* see below */
426 /* Retry data flags */
428 #define rf_delete 0x0001 /* retry info is to be deleted */
429 #define rf_host 0x0002 /* retry info is for a remote host */
430 #define rf_message 0x0004 /* retry info is for a host+message */
432 /* Information about a constructed message that is to be sent using the
433 autoreply transport. This is pointed to from the address block. */
435 typedef struct reply_item {
436 uschar *from; /* ) */
437 uschar *reply_to; /* ) */
439 uschar *cc; /* ) specific header fields */
441 uschar *subject; /* ) */
442 uschar *headers; /* misc other headers, concatenated */
443 uschar *text; /* text string body */
444 uschar *file; /* file body */
445 BOOL file_expand; /* expand the body */
446 int expand_forbid; /* expansion lockout flags */
447 uschar *logfile; /* file to keep a log in */
448 uschar *oncelog; /* file to keep records in for once only */
449 time_t once_repeat; /* time to repeat "once only" */
450 BOOL return_message; /* send back the original message */
454 /* The address_item structure contains many fields which are used at various
455 times while delivering a message. Some are used only for remote deliveries;
456 some only for local. A particular set of fields is copied whenever a child
457 address is created. For convenience, we keep those fields in a separate
458 sub-structure so they can be copied in one go. This also means I won't forget
459 to edit the various copying places when new to-be-copied fields are added. */
461 typedef struct address_item_propagated {
462 uschar *address_data; /* arbitrary data to keep with the address */
463 uschar *domain_data; /* from "domains" lookup */
464 uschar *localpart_data; /* from "local_parts" lookup */
465 uschar *errors_address; /* where to send errors (NULL => sender) */
466 header_line *extra_headers; /* additional headers */
467 uschar *remove_headers; /* list of those to remove */
469 #ifdef EXPERIMENTAL_SRS
470 uschar *srs_sender; /* Change return path when delivering */
473 BOOL utf8_msg:1; /* requires SMTPUTF8 processing */
474 BOOL utf8_downcvt:1; /* mandatory downconvert on delivery */
475 BOOL utf8_downcvt_maybe:1; /* optional downconvert on delivery */
477 } address_item_propagated;
479 /* Bits for the flags field below */
481 #define af_allow_file 0x00000001 /* allow file in generated address */
482 #define af_allow_pipe 0x00000002 /* allow pipe in generated address */
483 #define af_allow_reply 0x00000004 /* allow autoreply in generated address */
484 #define af_dr_retry_exists 0x00000008 /* router retry record exists */
485 #define af_expand_pipe 0x00000010 /* expand pipe arguments */
486 #define af_file 0x00000020 /* file delivery; always with pfr */
487 #define af_gid_set 0x00000040 /* gid field is set */
488 #define af_home_expanded 0x00000080 /* home_dir is already expanded */
489 #define af_ignore_error 0x00000100 /* ignore delivery error */
490 #define af_initgroups 0x00000200 /* use initgroups() for local transporting */
491 #define af_local_host_removed 0x00000400 /* local host was backup */
492 #define af_lt_retry_exists 0x00000800 /* local transport retry exists */
493 #define af_pfr 0x00001000 /* pipe or file or reply delivery */
494 #define af_retry_skipped 0x00002000 /* true if retry caused some skipping */
495 #define af_retry_timedout 0x00004000 /* true if retry timed out */
496 #define af_uid_set 0x00008000 /* uid field is set */
497 #define af_hide_child 0x00010000 /* hide child in bounce/defer msgs */
498 #define af_sverify_told 0x00020000 /* sender verify failure notified */
499 #define af_verify_pmfail 0x00040000 /* verify failure was postmaster callout */
500 #define af_verify_nsfail 0x00080000 /* verify failure was null sender callout */
501 #define af_homonym 0x00100000 /* an ancestor has same address */
502 #define af_verify_routed 0x00200000 /* for cached sender verify: routed OK */
503 #define af_verify_callout 0x00400000 /* for cached sender verify: callout was specified */
504 #define af_include_affixes 0x00800000 /* delivered with affixes in RCPT */
505 #define af_cert_verified 0x01000000 /* delivered with verified TLS cert */
506 #define af_pass_message 0x02000000 /* pass message in bounces */
507 #define af_bad_reply 0x04000000 /* filter could not generate autoreply */
509 # define af_prdr_used 0x08000000 /* delivery used SMTP PRDR */
511 #define af_force_command 0x10000000 /* force_command in pipe transport */
512 #ifdef EXPERIMENTAL_DANE
513 # define af_dane_verified 0x20000000 /* TLS cert verify done with DANE */
516 # define af_utf8_downcvt 0x40000000 /* downconvert was done for delivery */
519 /* These flags must be propagated when a child is created */
521 #define af_propagate (af_ignore_error)
523 /* The main address structure. Note that fields that are to be copied to
524 generated addresses should be put in the address_item_propagated structure (see
525 above) rather than directly into the address_item structure. */
527 typedef struct address_item {
528 struct address_item *next; /* for chaining addresses */
529 struct address_item *parent; /* parent address */
530 struct address_item *first; /* points to first after group delivery */
531 struct address_item *dupof; /* points to address this is a duplicate of */
533 router_instance *start_router; /* generated address starts here */
534 router_instance *router; /* the router that routed */
535 transport_instance *transport; /* the transport to use */
537 host_item *host_list; /* host data for the transport */
538 host_item *host_used; /* host that took delivery or failed hard */
539 host_item *fallback_hosts; /* to try if delivery defers */
541 reply_item *reply; /* data for autoreply */
542 retry_item *retries; /* chain of retry information */
544 uschar *address; /* address being delivered or routed */
545 uschar *unique; /* used for disambiguating */
546 uschar *cc_local_part; /* caseful local part */
547 uschar *lc_local_part; /* lowercased local part */
548 uschar *local_part; /* points to cc or lc version */
549 uschar *prefix; /* stripped prefix of local part */
550 uschar *suffix; /* stripped suffix of local part */
551 const uschar *domain; /* working domain (lower cased) */
553 uschar *address_retry_key; /* retry key including full address */
554 uschar *domain_retry_key; /* retry key for domain only */
556 uschar *current_dir; /* current directory for transporting */
557 uschar *home_dir; /* home directory for transporting */
558 uschar *message; /* error message */
559 uschar *user_message; /* error message that can be sent over SMTP
560 or quoted in bounce message */
561 uschar *onetime_parent; /* saved original parent for onetime */
562 uschar **pipe_expandn; /* numeric expansions for pipe from filter */
563 uschar *return_filename; /* name of return file */
564 uschar *self_hostname; /* after self=pass */
565 uschar *shadow_message; /* info about shadow transporting */
568 uschar *cipher; /* Cipher used for transport */
569 void *ourcert; /* Certificate offered to peer, binary */
570 void *peercert; /* Certificate from peer, binary */
571 uschar *peerdn; /* DN of server's certificate */
572 int ocsp; /* OCSP status of peer cert */
575 #ifdef EXPERIMENTAL_DSN_INFO
576 const uschar *smtp_greeting; /* peer self-identification */
577 const uschar *helo_response; /* peer message */
580 uschar *authenticator; /* auth driver name used by transport */
581 uschar *auth_id; /* auth "login" name used by transport */
582 uschar *auth_sndr; /* AUTH arg to SMTP MAIL, used by transport */
584 uschar *dsn_orcpt; /* DSN orcpt value */
585 int dsn_flags; /* DSN flags */
586 int dsn_aware; /* DSN aware flag */
588 uid_t uid; /* uid for transporting */
589 gid_t gid; /* gid for transporting */
591 unsigned int flags; /* a row of bits, defined above */
592 unsigned int domain_cache[(MAX_NAMED_LIST * 2)/32];
593 unsigned int localpart_cache[(MAX_NAMED_LIST * 2)/32];
594 int mode; /* mode for local transporting to a file */
595 int more_errno; /* additional error information */
596 /* (may need to hold a timestamp) */
598 short int basic_errno; /* status after failure */
599 short int child_count; /* number of child addresses */
600 short int return_file; /* fileno of return data file */
601 short int special_action; /* ( used when when deferred or failed */
603 /* ( contains = or - when successful SMTP delivered */
605 /* ( contains verify rc in sender verify cache */
606 short int transport_return; /* result of delivery attempt */
607 address_item_propagated prop; /* fields that are propagated to children */
610 /* The table of header names consists of items of this type */
619 /* Chain of information about errors (e.g. bad addresses) */
621 typedef struct error_block {
622 struct error_block *next;
627 /* Chain of file names when processing the queue */
629 typedef struct queue_filename {
630 struct queue_filename *next;
635 /* Chain of items of retry information, read from the retry config. */
637 typedef struct retry_rule {
638 struct retry_rule *next;
645 typedef struct retry_config {
646 struct retry_config *next;
654 /* Structure for each node in a tree, of which there are various kinds */
656 typedef struct tree_node {
657 struct tree_node *left; /* pointer to left child */
658 struct tree_node *right; /* pointer to right child */
661 void *ptr; /* pointer to data */
662 int val; /* or integer data */
664 uschar balance; /* balancing factor */
665 uschar name[1]; /* node name - variable length */
668 /* Structure for holding time-limited data such as DNS returns.
669 We use this rather than extending tree_node to avoid wasting
670 space for most tree use (variables...) at the cost of complexity
671 for the lookups cache */
673 typedef struct expiring_data {
674 time_t expiry; /* if nonzero, data invalid after this time */
675 void *ptr; /* pointer to data */
678 /* Structure for holding the handle and the cached last lookup for searches.
679 This block is pointed to by the tree entry for the file. The file can get
680 closed if too many are opened at once. There is a LRU chain for deciding which
683 typedef struct search_cache {
684 void *handle; /* lookup handle, or NULL if closed */
685 int search_type; /* search type */
686 tree_node *up; /* LRU up pointer */
687 tree_node *down; /* LRU down pointer */
688 tree_node *item_cache; /* tree of cached results */
691 /* Structure for holding a partially decoded DNS record; the name has been
692 uncompressed, but the data pointer is into the raw data. */
695 uschar name[DNS_MAXNAME]; /* domain name */
696 int type; /* record type */
697 unsigned short ttl; /* time-to-live, seconds */
698 int size; /* size of data */
699 uschar *data; /* pointer to data */
702 /* Structure for holding the result of a DNS query. */
705 int answerlen; /* length of the answer */
706 uschar answer[MAXPACKET]; /* the answer itself */
709 /* Structure for holding the intermediate data while scanning a DNS answer
713 int rrcount; /* count of RRs in the answer */
714 uschar *aptr; /* pointer in the answer while scanning */
715 dns_record srr; /* data from current record in scan */
718 /* Structure for holding a chain of IP addresses that are extracted from
719 an A, AAAA, or A6 record. For the first two, there is only ever one address,
720 but the chaining feature of A6 allows for several addresses to be realized from
721 a single initial A6 record. The structure defines the address field of length
722 1. In use, a suitable sized block is obtained to hold the complete textual
725 typedef struct dns_address {
726 struct dns_address *next;
730 /* Structure used for holding intermediate data during MD5 computations. */
734 unsigned int abcd[4];
738 /* Structure used for holding intermediate data during SHA-1 computations. */
740 typedef struct sha1 {
746 /* Structure used to hold incoming packets of SMTP responses for a specific
747 socket. The packets which may contain multiple lines (and in some cases,
748 multiple responses). */
750 typedef struct smtp_inblock {
751 int sock; /* the socket */
752 int buffersize; /* the size of the buffer */
753 uschar *ptr; /* current position in the buffer */
754 uschar *ptrend; /* end of data in the buffer */
755 uschar *buffer; /* the buffer itself */
758 /* Structure used to hold buffered outgoing packets of SMTP commands for a
759 specific socket. The packets which may contain multiple lines when pipelining
762 typedef struct smtp_outblock {
763 int sock; /* the socket */
764 int cmd_count; /* count of buffered commands */
765 int buffersize; /* the size of the buffer */
766 BOOL authenticating; /* TRUE when authenticating */
767 uschar *ptr; /* current position in the buffer */
768 uschar *buffer; /* the buffer itself */
771 /* Structure to hold information about the source of redirection information */
773 typedef struct redirect_block {
774 uschar *string; /* file name or string */
775 uid_t *owners; /* allowed file owners */
776 gid_t *owngroups; /* allowed file groups */
777 struct passwd *pw; /* possible owner if not NULL */
778 int modemask; /* forbidden bits */
779 BOOL isfile; /* TRUE if string is a file name */
780 BOOL check_owner; /* TRUE, FALSE, or TRUE_UNSET */
781 BOOL check_group; /* TRUE, FALSE, or TRUE_UNSET */
784 /* Structure for passing arguments to check_host() */
786 typedef struct check_host_block {
787 const uschar *host_name;
788 const uschar *host_address;
789 const uschar *host_ipv4;
793 /* Structure for remembering lookup data when caching the result of
794 a lookup in a named list. */
796 typedef struct namedlist_cacheblock {
797 struct namedlist_cacheblock *next;
800 } namedlist_cacheblock;
802 /* Structure for holding data for an entry in a named list */
804 typedef struct namedlist_block {
805 const uschar *string; /* the list string */
806 namedlist_cacheblock *cache_data; /* cached domain_data or localpart_data */
807 int number; /* the number of the list for caching */
810 /* Structures for Access Control Lists */
812 typedef struct acl_condition_block {
813 struct acl_condition_block *next;
820 } acl_condition_block;
822 typedef struct acl_block {
823 struct acl_block *next;
824 acl_condition_block *condition;
828 /* smtp transport calc outbound_ip */
829 typedef BOOL (*oicf) (uschar *message_id, void *data);
831 /* DKIM information for transport */
834 uschar *dkim_private_key;
835 uschar *dkim_selector;
837 uschar *dkim_sign_headers;
841 /* End of structs.h */