1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
$NetBSD: patch-ag,v 1.8 2003/04/17 06:22:19 martti Exp $
--- src/cleanup/cleanup.c.orig 2002-12-20 03:33:40.000000000 +0200
+++ src/cleanup/cleanup.c 2003-04-17 08:54:39.000000000 +0300
@@ -333,6 +333,7 @@
* 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,
--- src/cleanup/cleanup.h.orig 2002-12-03 16:58:11.000000000 +0200
+++ src/cleanup/cleanup.h 2003-04-17 08:54:39.000000000 +0300
@@ -118,6 +118,7 @@
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[];
--- src/cleanup/cleanup_envelope.c.orig 2002-11-01 15:34:02.000000000 +0200
+++ src/cleanup/cleanup_envelope.c 2003-04-17 08:54:39.000000000 +0300
@@ -192,15 +192,19 @@
if (state->orig_rcpt == 0)
state->orig_rcpt = mystrdup(buf);
cleanup_rewrite_internal(clean_addr, *buf ? buf : var_empty_addr);
- if (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_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);
+ if (var_canon_env_rcpt) {
+ if (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_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, state->orig_rcpt, STR(clean_addr));
if (state->recip == 0)
state->recip = mystrdup(STR(clean_addr));
--- src/cleanup/cleanup_init.c.orig 2002-12-03 16:56:56.000000000 +0200
+++ src/cleanup/cleanup_init.c 2003-04-17 08:54:39.000000000 +0300
@@ -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).
@@ -109,6 +111,7 @@
int var_extra_rcpt_limit; /* recipient extract limit */
char *var_rcpt_witheld; /* recipients not disclosed */
char *var_masq_classes; /* what to masquerade */
+bool var_canon_env_rcpt; /* canonicalize envelope recipient */
int var_qattr_count_limit; /* named attribute limit */
int var_body_check_len; /* when to stop body scan */
@@ -145,6 +148,11 @@
0,
};
+CONFIG_BOOL_TABLE cleanup_bool_table[] = {
+ VAR_CANON_ENV_RCPT, DEF_CANON_ENV_RCPT, &var_canon_env_rcpt,
+ 0,
+};
+
/*
* Mappings.
*/
--- src/global/mail_params.h.orig 2003-04-17 08:54:22.000000000 +0300
+++ src/global/mail_params.h 2003-04-17 08:54:39.000000000 +0300
@@ -324,6 +324,10 @@
#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;
|