Postfix3.3.1
int_filt.c
[詳解]
1 /*++
2 /* NAME
3 /* int_filt 3
4 /* SUMMARY
5 /* internal mail filter control
6 /* SYNOPSIS
7 /* #include <int_filt.h>
8 /*
9 /* int int_filt_flags(class)
10 /* int class;
11 /* DESCRIPTION
12 /* int_filt_flags() determines the appropriate mail filtering
13 /* flags for the cleanup server, depending on the setting of
14 /* the internal_mail_filter_classes configuration parameter.
15 /*
16 /* Specify one of the following:
17 /* .IP MAIL_SRC_MASK_NOTIFY
18 /* Postmaster notifications from the smtpd(8) and smtp(8)
19 /* protocol adapters.
20 /* .IP MAIL_SRC_MASK_BOUNCE
21 /* Delivery status notifications from the bounce(8) server.
22 /* .PP
23 /* Other MAIL_SRC_MASK_XXX arguments are permited but will
24 /* have no effect.
25 /* DIAGNOSTICS
26 /* Fatal: invalid mail category name.
27 /* LICENSE
28 /* .ad
29 /* .fi
30 /* The Secure Mailer license must be distributed with this software.
31 /* AUTHOR(S)
32 /* Wietse Venema
33 /* IBM T.J. Watson Research
34 /* P.O. Box 704
35 /* Yorktown Heights, NY 10598, USA
36 /*--*/
37 
38 /* System library. */
39 
40 #include <sys_defs.h>
41 
42 /* Utility library. */
43 
44 #include <name_mask.h>
45 #include <msg.h>
46 
47 /* Global library. */
48 
49 #include <mail_params.h>
50 #include <cleanup_user.h>
51 #include <mail_proto.h>
52 #include <int_filt.h>
53 
54 /* int_filt_flags - map mail class to submission flags */
55 
56 int int_filt_flags(int class)
57 {
58  static const NAME_MASK table[] = {
66  0,
67  };
68  int filtered_classes = 0;
69 
70  if (class && *var_int_filt_classes) {
71  filtered_classes =
73  if (filtered_classes == 0)
74  msg_warn("%s: bad input: %s", VAR_INT_FILT_CLASSES,
76  if (filtered_classes & class)
78  }
79  return (0);
80 }
#define MAIL_SRC_NAME_VERIFY
Definition: mail_proto.h:74
#define VAR_INT_FILT_CLASSES
Definition: mail_params.h:3440
#define MAIL_SRC_NAME_NOTIFY
Definition: mail_proto.h:73
char * var_int_filt_classes
Definition: mail_params.c:331
#define CLEANUP_FLAG_FILTER
Definition: cleanup_user.h:19
#define CLEANUP_FLAG_MILTER
Definition: cleanup_user.h:24
#define MAIL_SRC_MASK_NOTIFY
Definition: mail_proto.h:82
#define MAIL_SRC_NAME_SENDMAIL
Definition: mail_proto.h:68
#define MAIL_SRC_NAME_FORWARD
Definition: mail_proto.h:71
#define MAIL_SRC_NAME_BOUNCE
Definition: mail_proto.h:72
#define MAIL_SRC_MASK_BOUNCE
Definition: mail_proto.h:81
void msg_warn(const char *fmt,...)
Definition: msg.c:215
#define name_mask(tag, table, str)
Definition: name_mask.h:49
#define MAIL_SRC_NAME_QMQPD
Definition: mail_proto.h:70
#define MAIL_SRC_NAME_SMTPD
Definition: mail_proto.h:69
int int_filt_flags(int class)
Definition: int_filt.c:56