No empty .Rs/.Re
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / int_filt.c
blob1276131c04d581fe40c70f4614b5e3c580ec1b23
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* int_filt 3
6 /* SUMMARY
7 /* internal mail filter control
8 /* SYNOPSIS
9 /* #include <int_filt.h>
11 /* int int_filt_flags(class)
12 /* int class;
13 /* DESCRIPTION
14 /* int_filt_flags() determines the appropriate mail filtering
15 /* flags for the cleanup server, depending on the setting of
16 /* the internal_mail_filter_classes configuration parameter.
18 /* Specify one of the following:
19 /* .IP INT_FILT_MASK_NONE
20 /* Mail that must be excluded from inspection (address probes, etc.).
21 /* .IP INT_FILT_MASK_NOTIFY
22 /* Postmaster notifications from the smtpd(8) and smtp(8)
23 /* protocol adapters.
24 /* .IP INT_FILT_MASK_BOUNCE
25 /* Delivery status notifications from the bounce(8) server.
26 /* DIAGNOSTICS
27 /* Fatal: invalid mail category name.
28 /* LICENSE
29 /* .ad
30 /* .fi
31 /* The Secure Mailer license must be distributed with this software.
32 /* AUTHOR(S)
33 /* Wietse Venema
34 /* IBM T.J. Watson Research
35 /* P.O. Box 704
36 /* Yorktown Heights, NY 10598, USA
37 /*--*/
39 /* System library. */
41 #include <sys_defs.h>
43 /* Utility library. */
45 #include <name_mask.h>
46 #include <msg.h>
48 /* Global library. */
50 #include <mail_params.h>
51 #include <cleanup_user.h>
52 #include <int_filt.h>
54 /* int_filt_flags - map mail class to submission flags */
56 int int_filt_flags(int class)
58 static const NAME_MASK table[] = {
59 INT_FILT_CLASS_NOTIFY, INT_FILT_MASK_NOTIFY,
60 INT_FILT_CLASS_BOUNCE, INT_FILT_MASK_BOUNCE,
63 int filtered_classes = 0;
65 if (class && *var_int_filt_classes) {
66 filtered_classes =
67 name_mask(VAR_INT_FILT_CLASSES, table, var_int_filt_classes);
68 if (filtered_classes == 0)
69 msg_warn("%s: bad input: %s", VAR_INT_FILT_CLASSES,
70 var_int_filt_classes);
71 if (filtered_classes & class)
72 return (CLEANUP_FLAG_FILTER | CLEANUP_FLAG_MILTER);
74 return (0);