1 diff -up spamass-milter-0.3.1/spamass-milter.cpp.authuser spamass-milter-0.3.1/spamass-milter.cpp
2 --- spamass-milter-0.3.1/spamass-milter.cpp.authuser 2010-03-23 21:04:56.976920217 +0000
3 +++ spamass-milter-0.3.1/spamass-milter.cpp 2010-03-23 21:07:12.508020535 +0000
4 @@ -172,6 +172,7 @@ char *spambucket;
5 bool flag_full_email = false; /* pass full email address to spamc */
6 bool flag_expand = false; /* alias/virtusertable expansion */
7 bool warnedmacro = false; /* have we logged that we couldn't fetch a macro? */
8 +bool ignore_authenticated_senders = false; /* authenticated users bypass spam checks */
12 @@ -179,7 +180,7 @@ int
13 main(int argc, char* argv[])
16 - const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x";
17 + const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:x";
20 char *pidfilename = NULL;
21 @@ -211,6 +212,10 @@ main(int argc, char* argv[])
22 debug(D_MISC, "Parsing ignore list");
23 parse_networklist(optarg, &ignorenets);
26 + debug(D_MISC, "Ignore authenticated senders");
27 + ignore_authenticated_senders = true;
30 dontmodifyspam = true;
31 smfilter.xxfi_flags &= ~SMFIF_CHGBODY;
32 @@ -278,7 +283,7 @@ main(int argc, char* argv[])
33 cout << PACKAGE_NAME << " - Version " << PACKAGE_VERSION << endl;
34 cout << "SpamAssassin Sendmail Milter Plugin" << endl;
35 cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl;
36 - cout << " [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl;
37 + cout << " [-e defaultdomain] [-f] [-i networks] [-I] [-m] [-M]" << endl;
38 cout << " [-P pidfile] [-r nn] [-u defaultuser] [-x]" << endl;
39 cout << " [-- spamc args ]" << endl;
40 cout << " -p socket: path to create socket" << endl;
41 @@ -292,6 +297,7 @@ main(int argc, char* argv[])
42 cout << " -f: fork into background" << endl;
43 cout << " -i: skip (ignore) checks from these IPs or netblocks" << endl;
44 cout << " example: -i 192.168.12.5,10.0.0.0/8,172.16.0.0/255.255.0.0" << endl;
45 + cout << " -I: skip (ignore) checks if sender is authenticated" << endl;
46 cout << " -m: don't modify body, Content-type: or Subject:" << endl;
47 cout << " -M: don't modify the message at all" << endl;
48 cout << " -P pidfile: Put processid in pidfile" << endl;
49 @@ -746,6 +752,22 @@ mlfi_envfrom(SMFICTX* ctx, char** envfro
51 /* debug(D_ALWAYS, "ZZZ got private context %p", sctx); */
53 + if (ignore_authenticated_senders)
57 + auth_authen = smfi_getsymval(ctx, const_cast<char *>("{auth_authen}"));
58 + debug(D_MISC, "auth_authen=%s", auth_authen ?: "<unauthenticated>");
62 + debug(D_MISC, "sender authenticated (%s) - accepting message",
64 + debug(D_FUNC, "mlfi_envfrom: exit ignore");
65 + return SMFIS_ACCEPT;
69 debug(D_FUNC, "mlfi_envfrom: enter");
71 // launch new SpamAssassin
72 diff -up spamass-milter-0.3.1/spamass-milter.1.in.authuser spamass-milter-0.3.1/spamass-milter.1.in
73 --- spamass-milter-0.3.1/spamass-milter.1.in.authuser 2004-03-18 18:37:08.000000000 +0000
74 +++ spamass-milter-0.3.1/spamass-milter.1.in 2010-03-23 21:06:27.148897685 +0000
76 .Op Fl e Ar defaultdomain
83 @@ -119,6 +120,8 @@ Multiple
84 flags will append to the list.
85 For example, if you list all your internal networks, no outgoing emails
88 +Ignores messages if the sender has authenticated via SMTP AUTH.
90 Disables modification of the