You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Cecil Westerhof <Ce...@decebal.nl> on 2010/01/09 20:02:08 UTC

Documentation spamc -L is wrong

The documentation says:
      -L learn type, --learntype=type
           Send message to spamd for learning.  The "learn type" can be either spam, ham or forget.  The exitcode for spamc will be set
           to 5 if the message was learned, or 6 if it was already learned.

           Note that the "spamd" must run with the "--allow-tell" option for this to work.

But when I run spamc -L I get a return code 0 back. I am working with:
    SpamAssassin Client version 3.2.5

Also is it possible to do not have output? At hte moment I get:
    (Message was already un/learned)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Re: Documentation spamc -L is wrong

Posted by Cecil Westerhof <Ce...@decebal.nl>.
Cecil Westerhof <Ce...@decebal.nl> writes:

> The documentation says:
>       -L learn type, --learntype=type
>            Send message to spamd for learning.  The "learn type" can be either spam, ham or forget.  The exitcode for spamc will be set
>            to 5 if the message was learned, or 6 if it was already learned.
>
>            Note that the "spamd" must run with the "--allow-tell" option for this to work.
>
> But when I run spamc -L I get a return code 0 back. I am working with:
>     SpamAssassin Client version 3.2.5
>
> Also is it possible to do not have output? At hte moment I get:
>     (Message was already un/learned)

I now have also use not already processed spam. This also has an exit
code of 0 and gives as message:
    Message successfully un/learned

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Re: Documentation spamc -L is wrong

Posted by Mark Martinec <Ma...@ijs.si>.
On Sunday January 10 2010 09:06:21 Cecil Westerhof wrote:
> Later on in the manpage it says:
>     EXIT CODES
>            By default, spamc will use the 'safe fallback' error recovery
>  method.  That means, it will always exit with an exit code if 0, even if
>  an error was encountered.  If any error occurrs, it will simply pass
>  through the unaltered message.
> 
>            The -c and -E options modify this; instead, spamc will use an
>  exit code of 1 if the message is determined to be spam.
> 
> It looks like this is correct and the earlier statement not.

Would the following change to spamc.pod make it correct?


=item B<-L> I<learn type>, B<--learntype>=I<type>

Send message to spamd for learning.  The C<learn type> can be either spam,
ham or forget.  The exitcode for spamc will be set to 5 if the message
-was learned, or 6 if it was already learned.
+was learned, or 6 if it was already learned, under a condition that
+a B<--no-safe-fallback> option is selected too.


  Mark

Re: Documentation spamc -L is wrong

Posted by Cecil Westerhof <Ce...@decebal.nl>.
RW <rw...@googlemail.com> writes:

>> But when I run spamc -L I get a return code 0 back. I am working with:
>>     SpamAssassin Client version 3.2.5
>
>
> Have you checked spamc.conf to make sure there isn't a long forgotten
> -E or --exitcode lurking there?

SYSCONFDIR is not defined and in /etc/mail/spamassassin there is no
spamc.conf. So I think that is not the case.

Later on in the manpage it says:
    EXIT CODES
           By default, spamc will use the 'safe fallback' error recovery method.  That means, it will always exit with an exit code if 0,
           even if an error was encountered.  If any error occurrs, it will simply pass through the unaltered message.

           The -c and -E options modify this; instead, spamc will use an exit code of 1 if the message is determined to be spam.

It looks like this is correct and the earlier statement not.

In a way this is good: I do not need to work with 'set +e' and 'set -e'
and I can catch the output to decide what has happened.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Re: Documentation spamc -L is wrong

Posted by RW <rw...@googlemail.com>.
On Sat, 09 Jan 2010 20:02:08 +0100
Cecil Westerhof <Ce...@decebal.nl> wrote:


> But when I run spamc -L I get a return code 0 back. I am working with:
>     SpamAssassin Client version 3.2.5


Have you checked spamc.conf to make sure there isn't a long forgotten
-E or --exitcode lurking there?