You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2009/02/18 23:22:44 UTC

[Bug 6069] New: spamc: learning exit codes broken

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6069

           Summary: spamc: learning exit codes broken
           Product: Spamassassin
           Version: 3.2.5
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: spamc/spamd
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: guenther@rudersport.de


The spamc docs state:

  -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.

Doesn't work that way though. The exit code in both cases is 0 success,
regardless whether the message has been learned, or not. No difference with the
-x option.

  $ spamc -L ham < ham.msg; echo $?
  Message was already un/learned
  0

The code in spamc.c clearly shows, that EX_OK will be returned always. (Just
search for "Message was".)  Also applies to trunk, the code didn't change.


-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6069] spamc: learning exit codes documentation wrong, possible uncaught error

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6069


Karsten Bräckelmann <gu...@rudersport.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|spamc: learning exit codes  |spamc: learning exit codes
                   |broken                      |documentation wrong,
                   |                            |possible uncaught error




--- Comment #4 from Karsten Bräckelmann <gu...@rudersport.de>  2009-02-18 18:00:55 PST ---
(In reply to comment #2)
> rev 158134, looks like this was changed intentional, almost 4 years ago. Alas,
> the documentation hasn't been adjusted.
> 
> Hmm, so successful learning, unavailable (aka previously learned) and even
> *service unavailable* all are expected to return 0, success?  Seriously?

More digging.  Turns out all of this is bug 1201, revision 158029 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=158029 ) and some
fixes after that.

According to bug 1201 comment 47, 48 and 49 returning EX_OK indeed is the
desired behavior. Thus, concerning "successful learned" and "already learned"
this is a documentation bug.

Still unsure about the removed EX_UNAVAILABLE from revision 158134 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=158134 ).

Correcting Summary. And hoping the rev hints get linkified this time.


-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6069] spamc: learning exit codes broken

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6069





--- Comment #2 from Karsten Bräckelmann <gu...@rudersport.de>  2009-02-18 15:46:18 PST ---
Got the little bugger! :)

rev 158134, looks like this was changed intentional, almost 4 years ago. Alas,
the documentation hasn't been adjusted.

Hmm, so successful learning, unavailable (aka previously learned) and even
*service unavailable* all are expected to return 0, success?  Seriously?


-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6069] spamc: learning exit codes broken

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6069





--- Comment #1 from Karsten Bräckelmann <gu...@rudersport.de>  2009-02-18 14:32:41 PST ---
The fix should be quite trivial, adding 2 lines to set the ret value
accordingly. Now I just wonder which one is actually wrong -- the code or the
POD...


-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6069] spamc: learning exit codes broken

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6069





--- Comment #3 from Karsten Bräckelmann <gu...@rudersport.de>  2009-02-18 15:48:46 PST ---
(In reply to comment #2)
> rev 158134

http://svn.apache.org/viewvc?view=rev&revision=158134

Hrm, I was hoping for a link. Sorry for the noise.


-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.