Provide a switch to turn off envelope recipient canonicalization.

Canonicalizing the recipient is usually undesirable for sites that
have local delivery distributed over multiple machines.
This commit is contained in:
kim 2002-06-01 22:55:04 +00:00
parent aa309c7dc2
commit ab13a2b0d3
5 changed files with 28 additions and 10 deletions

View File

@ -281,6 +281,7 @@ int main(int argc, char **argv)
* Pass control to the single-threaded service skeleton.
*/
single_server_main(argc, argv, cleanup_service,
MAIL_SERVER_BOOL_TABLE, cleanup_bool_table,
MAIL_SERVER_INT_TABLE, cleanup_int_table,
MAIL_SERVER_STR_TABLE, cleanup_str_table,
MAIL_SERVER_TIME_TABLE, cleanup_time_table,

View File

@ -109,6 +109,7 @@ extern void cleanup_free(CLEANUP_STATE *);
extern void cleanup_all(void);
extern void cleanup_pre_jail(char *, char **);
extern void cleanup_post_jail(char *, char **);
extern CONFIG_BOOL_TABLE cleanup_bool_table[];
extern CONFIG_INT_TABLE cleanup_int_table[];
extern CONFIG_STR_TABLE cleanup_str_table[];
extern CONFIG_TIME_TABLE cleanup_time_table[];

View File

@ -166,15 +166,19 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type, char *buf,
return;
}
cleanup_rewrite_internal(clean_addr, *buf ? buf : var_empty_addr);
if (var_canon_env_rcpt) {
if (cleanup_rcpt_canon_maps)
cleanup_map11_internal(state, clean_addr, cleanup_rcpt_canon_maps,
cleanup_map11_internal(state, clean_addr,
cleanup_rcpt_canon_maps,
cleanup_ext_prop_mask & EXT_PROP_CANONICAL);
if (cleanup_comm_canon_maps)
cleanup_map11_internal(state, clean_addr, cleanup_comm_canon_maps,
cleanup_map11_internal(state, clean_addr,
cleanup_comm_canon_maps,
cleanup_ext_prop_mask & EXT_PROP_CANONICAL);
if (cleanup_masq_domains
&& (cleanup_masq_flags & CLEANUP_MASQ_FLAG_ENV_RCPT))
cleanup_masquerade_internal(clean_addr, cleanup_masq_domains);
}
cleanup_out_recipient(state, STR(clean_addr));
if (state->recip == 0)
state->recip = mystrdup(STR(clean_addr));

View File

@ -6,6 +6,8 @@
/* SYNOPSIS
/* #include "cleanup.h"
/*
/* CONFIG_BOOL_TABLE cleanup_bool_table[];
/*
/* CONFIG_INT_TABLE cleanup_int_table[];
/*
/* CONFIG_STR_TABLE cleanup_str_table[];
@ -28,7 +30,7 @@
/* for one-time initializations that must be done before any message
/* processing can take place.
/*
/* cleanup_{int,str,time}_table[] specify configuration
/* cleanup_{bool,int,str,time}_table[] specify configuration
/* parameters that must be initialized before calling any functions
/* in this module. These tables satisfy the interface as specified in
/* single_service(3).
@ -107,6 +109,7 @@ char *var_prop_extension; /* propagate unmatched extension */
char *var_always_bcc; /* big brother */
int var_extra_rcpt_limit; /* recipient extract limit */
char *var_rcpt_witheld; /* recipients not disclosed */
bool var_canon_env_rcpt; /* canonicalize envelope recipient */
char *var_masq_classes; /* what to masquerade */
CONFIG_INT_TABLE cleanup_int_table[] = {
@ -139,6 +142,11 @@ CONFIG_STR_TABLE cleanup_str_table[] = {
0,
};
CONFIG_BOOL_TABLE cleanup_bool_table[] = {
VAR_CANON_ENV_RCPT, DEF_CANON_ENV_RCPT, &var_canon_env_rcpt,
0,
};
/*
* Mappings.
*/

View File

@ -295,6 +295,10 @@ extern char *var_send_canon_maps;
#define DEF_RCPT_CANON_MAPS ""
extern char *var_rcpt_canon_maps;
#define VAR_CANON_ENV_RCPT "canonicalize_envelope_recipient"
#define DEF_CANON_ENV_RCPT 1
extern bool var_canon_env_rcpt;
#define VAR_TRANSPORT_MAPS "transport_maps"
#define DEF_TRANSPORT_MAPS ""
extern char *var_transport_maps;