Ivar Snaaijer said:
> I could be stating the obvious here but why not run it with & at the
> end ?

Because I run it in a slightly time-critical environment. As soon as
the call returns from sa-learn, the message file is moved (from
Maildir/tmp to Maildir/cur).

> My guess is that on most systems preloading the file into ram will not
> deliver significant gains as I suspect SA to already do some
> 'buffering'
> for itself.

I think it may be faster than writing it in a temporary file. Saves me
one write access (from my script) and one read access (from sa-learn).

The downside is that there may be a lot of messages to be learned as
spam in a short time. The calls to sa-learn will overlap sometimes.

> If your mail file is locked and you want to circumvent this you have
> copy it first in a temp file see example script.

It isn't locked, just moved elsewhere as soon as sa-learn finishes.

> salearnscript (3 lines):
>
> cp %1 /tmp/spamfile$$
> /usr/bin/sa-learn --no-rebuild --spam /tmp/spamfile$$
> rm /tmp/spamfile$$
>
> run this as
> salearnscript  <spamfile> &

So this script does not meet my requirements (sorry, I did not fully
specify them in my first mail).
It should:
 1) read the message file
 2) go into the background
 3) call sa-learn
 4) clean up if necessary

As soon as 2) is done, the original message file is moved elsewhere.
Maybe I'll have to use two scripts :-)

> Good luck.

Thanks. More hints?

cu
 Dave KLiczbor



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to