On Wed, 2009-01-28 at 14:01 -0700, LuKreme wrote:
> On 28-Jan-2009, at 10:25, Karsten Bräckelmann wrote:

> > Sure. See the -s option in 'man formail'.
> >
> >  formail -s ${command_per_mail}  < ${mbox}
> 
> Right.  As I originally posted:
> 
> formail -s procmail -m salrc <SPAM
> 
> salrc:
> :0 fw
> | sa-learn --spam

I keep forgetting details about that -m switch, but I would paranoidly
check that.  (a) There is no delivering receipt, so the (formail
calling) user's Inbox is a likely target.  (b) You are not locking the
sa-learn receipt. Dunno exactly if the formail wrapper will need it.
(c) You specified a filter. sa-learn isn't. It does not dump the mail
back to STDOUT, so procmail will complain about a lost mail and rescue
it.

That all said -- again, why do you want to use procmail? Given that
receipt its sole purpose is to fork a process. You do not need that. You
can have formail call sa-learn.


> > You will need procmail only, if you actually want to *conditionally*
> > perform action, e.g. skip learning of messages already scoring a high
> > Bayes value. Without any conditions (including post-processing and
> > different delivery targets), procmail just complicates things here.
> > Also, keep in mind that procmail would *deliver* the mail -- careful
> > with that, unless you want the learned messages to be fed to the user's
> > Inbox again. ;-)
> 
> No, what I want to do is process the current SPAM mailboxes before I  
> setup an automated learning on all future SPAM tagged mail

Right, I did understand that. My point is, you'd better be careful to
NOT have procmail deliver the processed spam a second time. Because you
do not want that.


> > Another caveat is, that calling a sa-learn process for *each* message is
> > quite expensive. Having a look at the spamc/spamd options for learning
> > might be a good idea.
> 
> Wha?  spamc has learning options?

Actually, IMHO, spamd has -- if you allow it. :)  Granted, spamc does
have a learning option, though the bulk is handled by spamd.

Please note the caveat about users, trust, and maliciously learning
messages for other users. See the spamd man-page.

> OK, so I'm not seeing an --all-tell in the ps output, so I will need  
> to change /usr/local/etc/rc.d/spamd.sh?
> 
>          /usr/local/bin/spamd  -d  && echo -n ' spamd'
> 
> to
>          /usr/local/bin/spamd  -d --allow-tell && echo -n ' spamd'

If that's how spamd is being started -- looks about right. See the spamd
man-page for details.

> and then just
> 
> :0 fw
> | spamc -L spam
> 
> well, that's better than throwing future messages at sa-learn.

Still don't see why you insist on using procmail for that trivial
receipt. ;)

  guenther


-- 
char *t="\10pse\0r\0dtu...@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}

Reply via email to