Lines 170-175
Link Here
|
170 |
bool flag_full_email = false; /* pass full email address to spamc */ |
170 |
bool flag_full_email = false; /* pass full email address to spamc */ |
171 |
bool flag_expand = false; /* alias/virtusertable expansion */ |
171 |
bool flag_expand = false; /* alias/virtusertable expansion */ |
172 |
bool warnedmacro = false; /* have we logged that we couldn't fetch a macro? */ |
172 |
bool warnedmacro = false; /* have we logged that we couldn't fetch a macro? */ |
|
|
173 |
bool skipauthed = false; /* don't scan mails from authed peers */ |
173 |
|
174 |
|
174 |
#if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */ |
175 |
#if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */ |
175 |
static pthread_mutex_t popen_mutex = PTHREAD_MUTEX_INITIALIZER; |
176 |
static pthread_mutex_t popen_mutex = PTHREAD_MUTEX_INITIALIZER; |
Lines 181-187
Link Here
|
181 |
main(int argc, char* argv[]) |
182 |
main(int argc, char* argv[]) |
182 |
{ |
183 |
{ |
183 |
int c, err = 0; |
184 |
int c, err = 0; |
184 |
const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x"; |
185 |
const char *args = "fd:mMp:P:r:u:D:i:b:B:e:xs"; |
185 |
char *sock = NULL; |
186 |
char *sock = NULL; |
186 |
bool dofork = false; |
187 |
bool dofork = false; |
187 |
char *pidfilename = NULL; |
188 |
char *pidfilename = NULL; |
Lines 260-265
Link Here
|
260 |
case 'x': |
261 |
case 'x': |
261 |
flag_expand = true; |
262 |
flag_expand = true; |
262 |
break; |
263 |
break; |
|
|
264 |
case 's': |
265 |
skipauthed = true; |
266 |
break; |
263 |
case '?': |
267 |
case '?': |
264 |
err = 1; |
268 |
err = 1; |
265 |
break; |
269 |
break; |
Lines 281-287
Link Here
|
281 |
cout << "SpamAssassin Sendmail Milter Plugin" << endl; |
285 |
cout << "SpamAssassin Sendmail Milter Plugin" << endl; |
282 |
cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl; |
286 |
cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl; |
283 |
cout << " [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl; |
287 |
cout << " [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl; |
284 |
cout << " [-P pidfile] [-r nn] [-u defaultuser] [-x]" << endl; |
288 |
cout << " [-P pidfile] [-r nn] [-u defaultuser] [-x] [-s]" << endl; |
285 |
cout << " [-- spamc args ]" << endl; |
289 |
cout << " [-- spamc args ]" << endl; |
286 |
cout << " -p socket: path to create socket" << endl; |
290 |
cout << " -p socket: path to create socket" << endl; |
287 |
cout << " -b bucket: redirect spam to this mail address. The orignal" << endl; |
291 |
cout << " -b bucket: redirect spam to this mail address. The orignal" << endl; |
Lines 302-307
Link Here
|
302 |
cout << " -u defaultuser: pass the recipient's username to spamc.\n" |
306 |
cout << " -u defaultuser: pass the recipient's username to spamc.\n" |
303 |
" Uses 'defaultuser' if there are multiple recipients." << endl; |
307 |
" Uses 'defaultuser' if there are multiple recipients." << endl; |
304 |
cout << " -x: pass email address through alias and virtusertable expansion." << endl; |
308 |
cout << " -x: pass email address through alias and virtusertable expansion." << endl; |
|
|
309 |
cout << " -s: skip messages from authenticated peers" << endl; |
305 |
cout << " -- spamc args: pass the remaining flags to spamc." << endl; |
310 |
cout << " -- spamc args: pass the remaining flags to spamc." << endl; |
306 |
|
311 |
|
307 |
exit(EX_USAGE); |
312 |
exit(EX_USAGE); |
Lines 769-774
Link Here
|
769 |
struct context *sctx = (struct context *)smfi_getpriv(ctx); |
774 |
struct context *sctx = (struct context *)smfi_getpriv(ctx); |
770 |
char *queueid; |
775 |
char *queueid; |
771 |
|
776 |
|
|
|
777 |
// check for authenticated peer |
778 |
if (skipauthed && smfi_getsymval(ctx, "{auth_authen}") != NULL) { |
779 |
debug(D_MISC, "Authenticated peer, skip spam detection"); |
780 |
return SMFIS_ACCEPT; |
781 |
} |
782 |
|
772 |
if (sctx == NULL) |
783 |
if (sctx == NULL) |
773 |
{ |
784 |
{ |
774 |
debug(D_ALWAYS, "smfi_getpriv failed!"); |
785 |
debug(D_ALWAYS, "smfi_getpriv failed!"); |