Bug 5740 - It is impossible to report (to remote service) a message via spamc if bayes is disabled
Summary: It is impossible to report (to remote service) a message via spamc if bayes i...
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 3.2.1
Hardware: All Linux
: P3 major
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-05 10:38 UTC by Andrey Lelikov
Modified: 2007-12-05 12:53 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Lelikov 2007-12-05 10:38:30 UTC
spamassasin has a -r option to report message as spam (or ham). By default it
also calls learn method which fails if bayes is disabled. This may be disabled
by setting bayes_learn_during_report to 0. 
spamc has -C option for the same purpose, but it will never work if bayes is
disabled. spamc always sets set_remote and set_local flags, and spamd always
calls learn() if set_local flag is set - so bayes_learn_during_report option is
not checked and spamd fails with 'Can't call method "learn" on an undefined
value'. workaround is to comment following code in spamd, but this is ugly.

#  if ($hdrs->{set_local}) {
#    my $status = $spamtest->learn($mail, undef, ($hdrs->{message_class} eq
'spam' ? 1 : 0), 0);

#    push(@did_set, 'local') if ($status->did_learn());
#    $status->finish();
#  }