Index: spamass-milter.cpp =================================================================== RCS file: /cvsroot/spamass-milt/spamass-milt/spamass-milter.cpp,v --- spamass-milter.cpp 7 Apr 2005 02:04:24 -0000 1.88 +++ spamass-milter.cpp 19 Apr 2005 13:52:41 -0000 @@ -170,6 +170,7 @@ bool flag_full_email = false; /* pass full email address to spamc */ bool flag_expand = false; /* alias/virtusertable expansion */ bool warnedmacro = false; /* have we logged that we couldn't fetch a macro? */ +bool skipauthed = false; /* don't scan mails from authed peers */ #if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */ static pthread_mutex_t popen_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -181,7 +182,7 @@ main(int argc, char* argv[]) { int c, err = 0; - const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x"; + const char *args = "fd:mMp:P:r:u:D:i:b:B:e:xs"; char *sock = NULL; bool dofork = false; char *pidfilename = NULL; @@ -260,6 +261,9 @@ case 'x': flag_expand = true; break; + case 's': + skipauthed = true; + break; case '?': err = 1; break; @@ -281,7 +285,7 @@ cout << "SpamAssassin Sendmail Milter Plugin" << endl; cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl; cout << " [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl; - cout << " [-P pidfile] [-r nn] [-u defaultuser] [-x]" << endl; + cout << " [-P pidfile] [-r nn] [-u defaultuser] [-x] [-s]" << endl; cout << " [-- spamc args ]" << endl; cout << " -p socket: path to create socket" << endl; cout << " -b bucket: redirect spam to this mail address. The orignal" << endl; @@ -302,6 +306,7 @@ cout << " -u defaultuser: pass the recipient's username to spamc.\n" " Uses 'defaultuser' if there are multiple recipients." << endl; cout << " -x: pass email address through alias and virtusertable expansion." << endl; + cout << " -s: skip messages from authenticated peers" << endl; cout << " -- spamc args: pass the remaining flags to spamc." << endl; exit(EX_USAGE); @@ -769,6 +774,12 @@ struct context *sctx = (struct context *)smfi_getpriv(ctx); char *queueid; + // check for authenticated peer + if (skipauthed && smfi_getsymval(ctx, "{auth_authen}") != NULL) { + debug(D_MISC, "Authenticated peer, skip spam detection"); + return SMFIS_ACCEPT; + } + if (sctx == NULL) { debug(D_ALWAYS, "smfi_getpriv failed!");