Hello,

thank you all for your replies.

On Sat, Nov 06, 2010 at 08:43:15PM +0100, Karsten Bräckelmann wrote:
> On Sat, 2010-11-06 at 16:17 +0100, Oliver Block wrote:
> > I am experiencing the same problem. I was calling sa-learn as follows:
> 
> Since you didn't include the actual output, I assume by "experiencing
> the same" you also mean the same sa-learn result? Like this.
> 
>   Learned from 0 message(s) (4 message(s) examined).
Yes, expect the fact that in my case it says "Learned tokens from 0
message(s) (1 message(s) examined)", since I am only passing one message
to sa-learn each time.

> Point being, you are missing the --mbox option in your command, which is
> used in the referenced previous posts. You'd need that, if it actually
> is mbox format with one or more messages.
I thought the --mbox option is needed when the path to the mbox is given
as a command line argument. In my case the mail to learn is passed to
sa-learn via STDIN (or at least this is what I am aiming). It seems that
when I remove the "&" sa-learn received correctly the mail via STDIN
from mutt. But with the & it seems that it does not receive anything
(see the post of RW).

By the way, if I call sa-learn from the command line (with the "&") as 
described,
it works without problems.

> > <pipe-message> sa-learn --spam --no-sync -D bayes >> ~/.sa-learn.log 2>&1 &
> > 
> > Removing the "&" at the end of the sa-learn call, [...]
> > solved the problem for me. Then sa-learn correctly learns the spam mails.
> 
> One thing sticking out, common between you and the old post, is the
> usage of -D debugging and redirecting STDERR. In the referenced post,
> the user mentions that piping to 'less' shows the headers. Which sure
> does not require redirecting STDERR.
> 
> So, while I am not sure why this would be, I guess the issue is somehow
> related to using both, 2>&1 as well as & nohup.
> 
> If you drop the -D and STDERR redirection, but keep the & nohup, does it
> work for you?
I still get the message "Learned tokens from 0 message(s) (1 message(s)
examined)". I am not sure that is the reason for it (debug output being
deactivated), but I guess the reason it the same (no input via STDIN to
sa-learn).

> As RW just showed (nice one!), with the above command, sa-learn somehow
> gets fed empty messages...
I think this is in fact the problem. Maybe it is a mutt-related problem 
concerning the "&".

Best,
Oliver

Reply via email to