You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Kurt Yoder <ky...@shcorp.com> on 2004/02/10 18:37:14 UTC

script to report spam in a maildir directory

Hello list

I made a simple script to report all messages in a maildir directory using
"spamassassin -r". Perhaps it will be useful for someone reading... here it
is:


-- 
Kurt Yoder
Sport & Health network administrator

Re: script to report spam in a maildir directory

Posted by Kurt Yoder <ky...@shcorp.com>.
Brook Humphrey said:
> On Tuesday 10 February 2004 09:37, Kurt Yoder wrote:
>> Hello list
>>
>> I made a simple script to report all messages in a maildir directory using
>> "spamassassin -r". Perhaps it will be useful for someone reading... here it
>> is:
>
> what does  hte report this thing makes look like?

It doesn't create a report; instead, it reports the message as spam. You feed
it a directory containing maildir messages and then all messages in the
directory are reported as spam. It's essentially a multi-file front-end for
"spamassassin -r". Maildir directories contain many files but "spamassassin
-r" only wants to read its input from STDIN.

-- 
Kurt Yoder
Sport & Health network administrator


Re: script to report spam in a maildir directory

Posted by Brook Humphrey <ba...@webmedic.net>.
On Tuesday 10 February 2004 09:37, Kurt Yoder wrote:
> Hello list
>
> I made a simple script to report all messages in a maildir directory using
> "spamassassin -r". Perhaps it will be useful for someone reading... here it
> is:

what does  hte report this thing makes look like?
-- 
 -~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-
                                      Brook Humphrey           
        Mobile PC Medic, 420 1st, Cheney, WA 99004, 509-235-9107        
http://www.webmedic.net, bah@webmedic.net, bah@linux-mandrake.com   
                                 Holiness unto the Lord
 -~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-~`'~-

Re: script to report spam in a maildir directory

Posted by Kurt Yoder <ky...@shcorp.com>.
If you're running it on an in-use maildir directory, it may be dying because
the message has been moved out of the directory while the script is processing
it. I hadn't anticipated the script being used on an active maildir, so I
didn't plan for this kind of problem. I'm not sure how to address this
particular issue... any perl gurus care to chime in?

Winston Ojeda said:
> This is beautiful!
> It is exactly what I was looking for.
> I not only downloaded it but also ran it and it works
> great. Thanks a bunch!
>
> Only one of the messages had an error:
> razor2 report failed: Bad file descriptor Died at
> /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/Reporter.pm
> line 120, <GEN1> line 1.
>
> But I'll figure it out later.
>
> All I need to figure out now is how to make this bad
> boy fire up on its own as a cron job but only when
> there are say 20 spams in that folder. Maybe I'll set
> it to run weekly or something.
> Also, delete the messages upon successful reporting.
>
> Again, Thanks A bunch!
>
>
> Winston
>
> --- Kurt Yoder <ky...@shcorp.com> wrote:
>> Hello list
>>
>> I made a simple script to report all messages in a
>> maildir directory using
>> "spamassassin -r". Perhaps it will be useful for
>> someone reading... here it
>> is:
>>
>>
>> --
>> Kurt Yoder
>> Sport & Health network administrator
>>
>
>> ATTACHMENT part 2 application/x-perl
> name=report_spam.pl
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
>


-- 
Kurt Yoder

Re: script to report spam in a maildir directory

Posted by Winston Ojeda <oj...@yahoo.com>.
This is beautiful!
It is exactly what I was looking for.
I not only downloaded it but also ran it and it works
great. Thanks a bunch!

Only one of the messages had an error:
razor2 report failed: Bad file descriptor Died at
/usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/Reporter.pm
line 120, <GEN1> line 1.

But I'll figure it out later.

All I need to figure out now is how to make this bad
boy fire up on its own as a cron job but only when
there are say 20 spams in that folder. Maybe I'll set
it to run weekly or something.
Also, delete the messages upon successful reporting.

Again, Thanks A bunch!


Winston

--- Kurt Yoder <ky...@shcorp.com> wrote:
> Hello list
> 
> I made a simple script to report all messages in a
> maildir directory using
> "spamassassin -r". Perhaps it will be useful for
> someone reading... here it
> is:
> 
> 
> -- 
> Kurt Yoder
> Sport & Health network administrator
> 

> ATTACHMENT part 2 application/x-perl
name=report_spam.pl



__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html