1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 1995 - 2018 */
6 /* Copyright (c) The Exim Maintainers 2020 - 2021 */
7 /* See the file NOTICE for conditions of use and distribution. */
9 /* This header file contains the definitions of the structures used in the
10 various hints databases are also kept in this file, which is used by the
11 maintenance utilities as well as the main Exim binary. */
13 #ifndef HINTSDB_STRUCTS_H
14 #define HINTSDB_STRUCTS_H
17 /* Structure for carrying around an open DBM file, and an open locking file
18 that relates to it. */
26 /* Structures for records stored in exim database dbm files. They all
27 start with the same fields, described in the generic type. */
31 time_t time_stamp; /* Timestamp of writing */
35 /* This structure keeps track of retry information for a host or a local
41 time_t first_failed; /* Time of first failure */
42 time_t last_try; /* Time of last try */
43 time_t next_try; /* Time of next try */
44 BOOL expired; /* Retry time has expired */
45 int basic_errno; /* Errno of last failure */
46 int more_errno; /* Additional information */
47 uschar text[1]; /* Text message for last failure */
50 /* These structures keep track of addresses that have had callout verification
51 performed on them. There are two groups of records:
53 1. keyed by localpart@domain -
54 Full address was tested and record holds result
57 Domain response upto MAIL FROM:<>, postmaster, random local part;
59 If a record exists, the result field is either ccache_accept or ccache_reject,
60 or, for a domain record only, ccache_reject_mfnull when MAIL FROM:<> was
61 rejected. The other fields, however, (which are only relevant to domain
62 records) may also contain ccache_unknown if that particular test has not been
65 Originally, there was only one structure, used for both types. However, it got
66 expanded for domain records, so it got split. To make it possible for Exim to
67 handle the old type of record, we retain the old definition. The different
68 kinds of record can be distinguished by their different lengths. */
74 int postmaster_result; /* Postmaster is accepted */
75 int random_result; /* Random local part was accepted */
76 } dbdata_callout_cache_obs;
79 time_t time_stamp; /* Timestamp of last address check */
81 int result; /* accept or reject */
82 } dbdata_callout_cache_address;
84 /* For this new layout, we put the additional fields (the timestamps)
85 last so that if somebody reverts to an older Exim, the new records will
86 still make sense because they match the old layout. */
89 time_t time_stamp; /* Time stamp of last connection */
91 int result; /* Domain reject or accept */
92 int postmaster_result; /* Postmaster result */
93 int random_result; /* Random result */
94 time_t postmaster_stamp; /* Timestamp of postmaster check */
95 time_t random_stamp; /* Timestamp of random check */
96 } dbdata_callout_cache;
98 /* This structure keeps track of messages that are waiting for a particular
99 host for a particular transport. */
104 int count; /* Count of message ids */
105 int sequence; /* Sequence for continued records */
106 uschar text[1]; /* One long character string */
110 /* The contents of the "misc" database are a mixture of different kinds of
111 record, as defined below. The keys used for a specific type all start with a
112 given string such as "etrn-" or "host-serialize-". */
115 /* This structure records a connection to a particular host, for the
116 purpose of serializing access to certain hosts. For possible future extension,
117 a field is defined for holding the count of connections, but it is not
118 at present in use. The same structure is used for recording a running ETRN
124 int count; /* Reserved for possible connection count */
128 /* This structure records the information required for the ratelimit
134 int time_usec; /* Fractional part of time, from gettimeofday() */
135 double rate; /* Smoothed sending rate at that time */
138 /* Same as above, plus a Bloom filter for uniquifying events. */
141 dbdata_ratelimit dbd;
142 time_t bloom_epoch; /* When the Bloom filter was last reset */
143 unsigned bloom_size; /* Number of bytes in the Bloom filter */
144 uschar bloom[40]; /* Bloom filter which may be larger than this */
145 } dbdata_ratelimit_unique;
148 /* For "seen" ACL condition */
153 #ifndef DISABLE_PIPE_CONNECT
154 /* This structure records the EHLO responses, cleartext and crypted,
155 for an IP, as bitmasks (cf. OPTION_TLS). For LIMITS, also values
156 advertised for MAILMAX, RCPTMAX and RCPTDOMAINMAX; zero meaning no
160 unsigned short cleartext_features;
161 unsigned short crypted_features;
162 unsigned short cleartext_auths;
163 unsigned short crypted_auths;
165 # ifdef EXPERIMENTAL_ESMTP_LIMITS
166 unsigned int limit_mail;
167 unsigned int limit_rcpt;
168 unsigned int limit_rcptdom;
175 ehlo_resp_precis data;
182 uschar verify_override:1;
185 } dbdata_tls_session;
188 #endif /* whole file */
189 /* End of hintsdb_structs.h */