Script question

Lt. Commander listmgr at
Sat Jun 13 00:31:05 UTC 2015

-----Original Message-----
From: olivier2553 at [mailto:olivier2553 at] On Behalf Of Olivier Nicole
Sent: Friday, June 12, 2015 7:19 PM
To: Lt. Commander
Cc: freebsd-questions at
Subject: Re: Script question


> I would like to be able to scan the daily maillog with a script at midnight to extract a list by selecting spam recognized and contained using the constant "score=(greater than x) and from that a list of just the IPs which will be placed in a spam file as part of a spam system here. Am tired of some getting past spamass even though it exceeds a reasonable tag level.
> I do know how to extract just the IP from a line in the log, but not sure what the syntax should be to first ID the "score=<x" in a simple sh shell script.

What would be the typical lines from the log?

I;d use Perl rather than sh.


> I hope this has been presented clear enough to gather some help on this task.
> Thanks,
> Jason


This is a typical line in the log. You see it has the info needed:

un 12 08:56:42 milter-spamc[58732]: 01937 t5CDueuM006830: spam=YES score=110.90 required=6.00 client_addr= client_name=[] subject='Re: I won't tell this secrect to anyone else...' mail=<info at> rcpts=<physics at>


More information about the freebsd-questions mailing list