1 Description: Add ignore authenticated senders option
2 From: Paul Traina <reportbug@st04.pst.org>
4 --- a/spamass-milter.1.in
5 +++ b/spamass-milter.1.in
7 .Op Fl e Ar defaultdomain
15 flags will append to the list.
16 For example, if you list all your internal networks, no outgoing emails
19 +Ignores messages if the sender has authenticated via SMTP AUTH.
21 Disables modification of the
23 --- a/spamass-milter.cpp
24 +++ b/spamass-milter.cpp
27 bool flag_full_email = false; /* pass full email address to spamc */
28 bool flag_expand = false; /* alias/virtusertable expansion */
29 +bool ignore_authenticated_senders = false;
30 bool warnedmacro = false; /* have we logged that we couldn't fetch a macro? */
31 bool auth = false; /* don't scan authenticated users */
34 main(int argc, char* argv[])
37 - const char *args = "afd:mMp:P:r:u:D:i:b:B:e:xS:R:C:";
38 + const char *args = "afd:mMp:P:r:u:D:i:Ib:B:e:xS:R:C:";
41 char *pidfilename = NULL;
43 debug(D_MISC, "Parsing ignore list");
44 parse_networklist(optarg, &ignorenets);
47 + debug(D_MISC, "Ignore authenticated senders");
48 + ignore_authenticated_senders = true;
51 dontmodifyspam = true;
52 smfilter.xxfi_flags &= ~SMFIF_CHGBODY;
54 cout << PACKAGE_NAME << " - Version " << PACKAGE_VERSION << endl;
55 cout << "SpamAssassin Sendmail Milter Plugin" << endl;
56 cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl;
57 - cout << " [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl;
58 + cout << " [-e defaultdomain] [-f] [-i networks] [-I] [-m] [-M]" << endl;
59 cout << " [-P pidfile] [-r nn] [-u defaultuser] [-x] [-a]" << endl;
60 cout << " [-C rejectcode] [ -R rejectmsg ]" << endl;
61 cout << " [-- spamc args ]" << endl;
63 cout << " -f: fork into background" << endl;
64 cout << " -i: skip (ignore) checks from these IPs or netblocks" << endl;
65 cout << " example: -i 192.168.12.5,10.0.0.0/8,172.16.0.0/255.255.0.0" << endl;
66 + cout << " -I: skip (ignore) checks if sender is authenticated" << endl;
67 cout << " -m: don't modify body, Content-type: or Subject:" << endl;
68 cout << " -M: don't modify the message at all" << endl;
69 cout << " -P pidfile: Put processid in pidfile" << endl;
75 + if (ignore_authenticated_senders)
79 + auth_authen = smfi_getsymval(ctx, "{auth_authen}");
80 + debug(D_MISC, "auth_authen=%s", auth_authen ?: "<unauthenticated>");
84 + debug(D_MISC, "sender authenticated (%s) - accepting message",
86 + debug(D_FUNC, "mlfi_envfrom: exit ignore");
87 + return SMFIS_ACCEPT;
91 debug(D_FUNC, "mlfi_envfrom: enter");