7 /* receive transparency control
9 /* #include <input_transp.h>
11 /* int input_transp_mask(param_name, pattern)
12 /* const char *param_name;
13 /* const char *pattern;
15 /* int input_transp_cleanup(cleanup_flags, transp_mask)
19 /* This module controls how much processing happens before mail is
20 /* written to the Postfix queue. Each transparency option is either
21 /* implemented by a client of the cleanup service, or is passed
22 /* along in a client request to the cleanup service. This eliminates
23 /* the need to configure multiple cleanup service instances.
25 /* input_transp_mask() takes a comma-separated list of names and
26 /* computes the corresponding mask. The following names are
27 /* recognized in \fBpattern\fR, with the corresponding bit mask
28 /* given in parentheses:
29 /* .IP "no_unknown_recipient_checks (INPUT_TRANSP_UNKNOWN_RCPT)"
30 /* Do not try to reject unknown recipients.
31 /* .IP "no_address_mappings (INPUT_TRANSP_ADDRESS_MAPPING)"
32 /* Disable canonical address mapping, virtual alias map expansion,
33 /* address masquerading, and automatic BCC recipients.
34 /* .IP "no_header_body_checks (INPUT_TRANSP_HEADER_BODY)"
35 /* Disable header/body_checks.
36 /* .IP "no_milters (INPUT_TRANSP_MILTER)"
37 /* Disable Milter applications.
39 /* input_transp_cleanup() takes a bunch of cleanup processing
40 /* flags and updates them according to the settings in the
41 /* specified input transparency mask.
43 /* Panic: inappropriate use.
47 /* The Secure Mailer license must be distributed with this software.
50 /* IBM T.J. Watson Research
52 /* Yorktown Heights, NY 10598, USA
59 /* Utility library. */
61 #include <name_mask.h>
66 #include <mail_params.h>
67 #include <cleanup_user.h>
68 #include <input_transp.h>
70 /* input_transp_mask - compute mail receive transparency mask */
72 int input_transp_mask(const char *param_name
, const char *pattern
)
74 static const NAME_MASK table
[] = {
75 "no_unknown_recipient_checks", INPUT_TRANSP_UNKNOWN_RCPT
,
76 "no_address_mappings", INPUT_TRANSP_ADDRESS_MAPPING
,
77 "no_header_body_checks", INPUT_TRANSP_HEADER_BODY
,
78 "no_milters", INPUT_TRANSP_MILTER
,
82 return (name_mask(param_name
, table
, pattern
));
85 /* input_transp_cleanup - adjust cleanup options */
87 int input_transp_cleanup(int cleanup_flags
, int transp_mask
)
89 const char *myname
= "input_transp_cleanup";
92 msg_info("before %s: cleanup flags = %s",
93 myname
, cleanup_strflags(cleanup_flags
));
94 if (transp_mask
& INPUT_TRANSP_ADDRESS_MAPPING
)
95 cleanup_flags
&= ~(CLEANUP_FLAG_BCC_OK
| CLEANUP_FLAG_MAP_OK
);
96 if (transp_mask
& INPUT_TRANSP_HEADER_BODY
)
97 cleanup_flags
&= ~CLEANUP_FLAG_FILTER
;
98 if (transp_mask
& INPUT_TRANSP_MILTER
)
99 cleanup_flags
&= ~CLEANUP_FLAG_MILTER
;
101 msg_info("after %s: cleanup flags = %s",
102 myname
, cleanup_strflags(cleanup_flags
));
103 return (cleanup_flags
);