<<< Date Index >>>     <<< Thread Index >>>

Re: Running a shell command while saving messages to mailboxes



On Thu, Dec 16, 2004 at 01:14:49PM +0100, Michael Kjorling wrote:
> On 2004-12-16 11:24 +0100, Sebastien.Hinderer@xxxxxxxxxxxxxx wrote:
> > The aim is to feed spamassassin automatically with all ham messages as
> > soon as they are saved to a milbox which is not =spam.
> > This would avoid having to call sa-learn regularly on several mailboxes,
> > which is anyway something non-trivial (atleast for me) as soon as
> > mailboxes ar stored in maildir format.
> 
> I'm not entirely up to speed on maildir, so the "cur" may be wrong,
> but what about a cron job doing something like this? (Assuming bash.)
> 
>       for msg in mailbox/cur/*
>       do
>         cat mailbox/cur/${msg} | sa-larn --ham
>       done

There's no need. sa-learn understands maildir format:

sa-learn [options] [file]...

So:

sa-learn --ham $HOME/Maildir/cur/*

will work just fine.

Read the sa-learn manpage -- you can even do multiple folders at
once, some of which are ham and some spam.

-dsr-

-- 
Nothing to sig here, move along.