Script question

jd1008 jd1008 at gmail.com
Sat Jun 13 01:17:22 UTC 2015



On 06/12/2015 06:29 PM, Lt. Commander wrote:
> -----Original Message-----
> From: olivier2553 at gmail.com [mailto:olivier2553 at gmail.com] On Behalf Of Olivier Nicole
> Sent: Friday, June 12, 2015 7:19 PM
> To: Lt. Commander
> Cc: freebsd-questions at freebsd.org
> Subject: Re: Script question
>
> Jason,
>
>> 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.
>
> Olivier
>
>
>> I hope this has been presented clear enough to gather some help on this task.
>>
>> Thanks,
>> Jason
> Oliver:
>
> This is a typical line in the log. You see it has the info needed:
>
> -----------------------------------------------------------------------------------------------
> un 12 08:56:42 myhost.com milter-spamc[58732]: 01937 t5CDueuM006830: spam=YES score=110.90 required=6.00 client_addr=117.62.50.137 client_name=[117.62.50.137] subject='Re: I won't tell this secrect to anyone else...' mail=<info at cse.gob.ni> rcpts=<physics at xxxx.com>
> -----------------------------------------------------------------------------------------------
>
> Thanks,
> Jason
>
Hi Jason,
Does the log consist of one liners as you show above?
In otherwords, is each one line entry for one message?
Are there more than 1 line per message in the log?


More information about the freebsd-questions mailing list