1 Description: Add ignore authenticated senders option
2 From: Paul Traina <reportbug@st04.pst.org>
4 Index: spamass-milter/spamass-milter.1.in
5 ===================================================================
6 --- spamass-milter.orig/spamass-milter.1.in 2012-06-21 12:53:44.000000000 -0700
7 +++ spamass-milter/spamass-milter.1.in 2012-06-21 12:56:56.000000000 -0700
9 .Op Fl e Ar defaultdomain
17 flags will append to the list.
18 For example, if you list all your internal networks, no outgoing emails
21 +Ignores messages if the sender has authenticated via SMTP AUTH.
23 Disables modification of the
25 Index: spamass-milter/spamass-milter.cpp
26 ===================================================================
27 --- spamass-milter.orig/spamass-milter.cpp 2012-06-21 12:53:49.000000000 -0700
28 +++ spamass-milter/spamass-milter.cpp 2012-06-21 12:56:56.000000000 -0700
31 bool flag_full_email = false; /* pass full email address to spamc */
32 bool flag_expand = false; /* alias/virtusertable expansion */
33 +bool ignore_authenticated_senders = false;
34 bool warnedmacro = false; /* have we logged that we couldn't fetch a macro? */
38 main(int argc, char* argv[])
41 - const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x";
42 + const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:x";
45 char *pidfilename = NULL;
47 debug(D_MISC, "Parsing ignore list");
48 parse_networklist(optarg, &ignorenets);
51 + debug(D_MISC, "Ignore authenticated senders");
52 + ignore_authenticated_senders = true;
55 dontmodifyspam = true;
56 smfilter.xxfi_flags &= ~SMFIF_CHGBODY;
58 cout << PACKAGE_NAME << " - Version " << PACKAGE_VERSION << endl;
59 cout << "SpamAssassin Sendmail Milter Plugin" << endl;
60 cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl;
61 - cout << " [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl;
62 + cout << " [-e defaultdomain] [-f] [-i networks] [-I] [-m] [-M]" << endl;
63 cout << " [-P pidfile] [-r nn] [-u defaultuser] [-x]" << endl;
64 cout << " [-- spamc args ]" << endl;
65 cout << " -p socket: path to create socket" << endl;
67 cout << " -f: fork into background" << endl;
68 cout << " -i: skip (ignore) checks from these IPs or netblocks" << endl;
69 cout << " example: -i 192.168.12.5,10.0.0.0/8,172.16.0.0/255.255.0.0" << endl;
70 + cout << " -I: skip (ignore) checks if sender is authenticated" << endl;
71 cout << " -m: don't modify body, Content-type: or Subject:" << endl;
72 cout << " -M: don't modify the message at all" << endl;
73 cout << " -P pidfile: Put processid in pidfile" << endl;
76 /* debug(D_ALWAYS, "ZZZ got private context %p", sctx); */
78 + if (ignore_authenticated_senders)
82 + auth_authen = smfi_getsymval(ctx, "{auth_authen}");
83 + debug(D_MISC, "auth_authen=%s", auth_authen ?: "<unauthenticated>");
87 + debug(D_MISC, "sender authenticated (%s) - accepting message",
89 + debug(D_FUNC, "mlfi_envfrom: exit ignore");
90 + return SMFIS_ACCEPT;
94 debug(D_FUNC, "mlfi_envfrom: enter");
96 // launch new SpamAssassin