extern tree_node *acl_var_create(uschar *);
extern void acl_var_write(uschar *, uschar *, void *);
+extern void add_driver_info(driver_info **, const driver_info *, size_t);
+
#ifdef EXPERIMENTAL_ARC
# ifdef SUPPORT_DMARC
extern int auth_prompt(const uschar *);
extern int auth_read_input(const uschar *);
extern gstring * auth_show_supported(gstring *);
-extern uschar *auth_xtextencode(uschar *, int);
-extern int auth_xtextdecode(uschar *, uschar **);
extern uschar *authenticator_current_name(void);
#ifdef EXPERIMENTAL_ARC
extern gstring *authres_dmarc(gstring *);
#endif
extern gstring *authres_smtpauth(gstring *);
-#ifdef SUPPORT_SPF
-extern gstring *authres_spf(gstring *);
-#endif
extern uschar *b64encode(const uschar *, int);
extern uschar *b64encode_taint(const uschar *, int, const void *);
extern void exim_setugid(uid_t, gid_t, BOOL, const uschar *);
extern void exim_underbar_exit(int) NORETURN;
extern void exim_wait_tick(struct timeval *, int);
-extern int exp_bool(address_item *addr,
- uschar *mtype, uschar *mname, unsigned dgb_opt, uschar *oname, BOOL bvalue,
- uschar *svalue, BOOL *rvalue);
-extern BOOL expand_check_condition(uschar *, uschar *, uschar *);
+extern int exp_bool(address_item *,
+ const uschar *, const uschar *, unsigned, uschar *, BOOL bvalue,
+ const uschar *, BOOL *);
+extern BOOL expand_check_condition(const uschar *, const uschar *, const uschar *);
extern uschar *expand_file_big_buffer(const uschar *);
extern uschar *expand_string(uschar *); /* public, cannot make const */
extern const uschar *expand_string_2(const uschar *, BOOL *);
extern const uschar *local_part_quote(const uschar *);
extern int log_open_as_exim(const uschar * const);
extern void log_close_all(void);
+extern const lookup_info * lookup_with_acq_num(unsigned);
+#ifdef LOOKUP_MODULE_DIR
+extern BOOL lookup_one_mod_load(const uschar *, uschar **);
+#endif
+
extern macro_item * macro_create(const uschar *, const uschar *, BOOL);
extern BOOL macro_read_assignment(uschar *);
extern int mime_regex(const uschar **, BOOL);
extern void mime_set_anomaly(int);
#endif
+extern misc_module_info * misc_mod_find(const uschar * modname, uschar **);
+extern misc_module_info * misc_mod_findonly(const uschar * modname);
extern uschar *moan_check_errorcopy(const uschar *);
extern BOOL moan_skipped_syntax_errors(uschar *, error_block *, uschar *,
BOOL, uschar *);
extern BOOL moan_to_sender(int, error_block *, header_line *, FILE *, BOOL);
extern void moan_write_from(FILE *);
extern void moan_write_references(FILE *, uschar *);
+#ifdef LOOKUP_MODULE_DIR
+//extern void mod_load_check(const uschar *);
+#endif
extern FILE *modefopen(const uschar *, const char *, mode_t);
extern int open_cutthrough_connection( address_item * addr );
extern int random_number(int);
extern const uschar *rc_to_string(int);
-extern int rda_interpret(redirect_block *, int, const uschar *, const uschar *,
- const uschar *, const uschar *, const uschar *, const ugid_block *, address_item **,
- uschar **, error_block **, int *, const uschar *);
+extern int rda_interpret(redirect_block *, int, const uschar *,
+ const sieve_block *, const ugid_block *, address_item **,
+ uschar **, error_block **, int *, const uschar *);
extern int rda_is_filter(const uschar *);
extern BOOL readconf_depends(driver_instance *, uschar *);
-extern void readconf_driver_init(uschar *, driver_instance **,
- driver_info *, int, void *, int, optionlist *, int);
+extern void readconf_driver_init(driver_instance **, driver_info **, int,
+ void *, int, optionlist *, int, const uschar *);
extern const uschar *readconf_find_option(void *);
extern void readconf_main(BOOL);
extern void readconf_options_from_list(optionlist *, unsigned, const uschar *, uschar *);
extern void route_tidyup(void);
extern uschar *router_current_name(void);
-extern uschar *search_args(int, uschar *, uschar *, uschar **, const uschar *);
-extern uschar *search_find(void *, const uschar *, uschar *, int,
+extern uschar *search_args(const lookup_info *, uschar *, uschar *, uschar **,
+ const uschar *);
+extern uschar *search_find(void *, const uschar *, const uschar *, int,
const uschar *, int, int, int *, const uschar *);
-extern int search_findtype(const uschar *, int);
-extern int search_findtype_partial(const uschar *, int *, const uschar **, int *,
- int *, const uschar **);
-extern void *search_open(const uschar *, int, int, uid_t *, gid_t *);
+extern const lookup_info * search_findtype(const uschar *, int);
+extern const lookup_info * search_findtype_partial(const uschar *, int *,
+ const uschar **, int *, int *, const uschar **);
+extern void *search_open(const uschar *, const lookup_info *, int,
+ uid_t *, gid_t *);
extern void search_tidyup(void);
extern BOOL send_fd_over_socket(int, int);
extern uschar *sender_helo_verified_boolstr(void);
extern void sha1_end(hctx *, const uschar *, int, uschar *);
extern void sha1_mid(hctx *, const uschar *);
extern void sha1_start(hctx *);
-extern int sieve_interpret(const uschar *, int, const uschar *,
- const uschar *, const uschar *, const uschar *,
+extern int sieve_interpret(const uschar *, int, const sieve_block *,
address_item **, uschar **);
extern void sigalrm_handler(int);
extern void single_queue_run(qrunner *, const uschar *, const uschar *);
extern const uschar *transport_rcpt_address(address_item *, BOOL);
extern BOOL transport_set_up_command(const uschar ***, const uschar *,
unsigned, int, address_item *, const uschar *, uschar **);
-extern void transport_update_waiting(host_item *, uschar *);
+extern void transport_update_waiting(host_item *, const uschar *);
extern BOOL transport_write_block(transport_ctx *, uschar *, int, BOOL);
extern void transport_write_reset(int);
extern BOOL transport_write_string(int, const char *, ...);
extern uschar * xclient_smtp_command(uschar *, int *, BOOL *);
extern gstring * xclient_smtp_advertise_str(gstring *);
#endif
+extern uschar *xtextencode(uschar *, int);
+extern int xtextdecode(uschar *, uschar **);
/******************************************************************************/
static inline uschar *
string_timediff(const struct timeval * diff)
{
-static uschar buf[sizeof("0.000s")];
+static uschar buf[16];
if (diff->tv_sec >= 5 || !LOGGING(millisec))
return readconf_printtime((int)diff->tv_sec);
-snprintf(CS buf, sizeof(buf), "%u.%03us", (uint)diff->tv_sec, (uint)diff->tv_usec/1000);
+snprintf(CS buf, sizeof(buf), "%u.%03us",
+ (uint)diff->tv_sec, (uint)diff->tv_usec/1000);
return buf;
}
/******************************************************************************/
# if !defined(COMPILE_UTILITY)
+
+/* We use the PID of the head process for a connection-id. Note that
+this is only for tracking a received connection and what it directly
+causes; there is no inttent to describe transport-initiated TCP connections.
+The value is intented to be a cookie usable for logging, and we might change
+the generator for it at any time. */
+
+static inline void
+set_connection_id(void)
+{
+connection_id = string_sprintf("%lu", (u_long)getpid());
+}
+
+
/* Process manipulation */
static inline pid_t