Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Spamassassin Bayes error [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
epig
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2005
Posts: 86

PostPosted: Mon Jul 05, 2021 11:56 am    Post subject: Spamassassin Bayes error [SOLVED] Reply with quote

Hi all,

After upgrading spamassassin fo v. 3.4.5 last week, I noticed a significan drop in spam caught.

Altough I didn't touch local.cf (that has worked fine for years) and the file looks exactly the same as before, it would seem that the update has broken the config...

Quote:

grond ~ # spamassassin --lint
Jul 5 13:38:36.201 [29329] warn: config: found endif without matching conditional
Jul 5 13:38:36.919 [29329] warn: lint: 1 issues detected, please rerun with debug enabled for more information


local.cf:

Code:


required_score 6.0
use_bayes 1
bayes_auto_learn 1

ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
shortcircuit USER_IN_BLACKLIST on
shortcircuit USER_IN_BLACKLIST_TO on
shortcircuit SUBJECT_IN_BLACKLIST on
endif # Mail::SpamAssassin::Plugin::Shortcircuit

include /etc/spamassassin/my_black_list.cf
 shortcircuit USER_IN_WHITELIST       on
 shortcircuit USER_IN_DEF_WHITELIST   on
 shortcircuit USER_IN_ALL_SPAM_TO     on
 shortcircuit SUBJECT_IN_WHITELIST    on

include /etc/spamassassin/my_white_list.cf

score BAYES_50 2.0
score BAYES_60 2.5
score BAYES_80 5.0
score BAYES_95 5.5
score BAYES_99 6.0
score BAYES_999 2.0
score RP_MATCHES_RCVD -1.0


endif  #Mail::SpamAssassin::Plugin::Shortcircuit



I am at a loss here, any tips or suggsetions? (I tried to post up the lint test output, but the forums don't seem to like that)


Last edited by epig on Tue Jul 06, 2021 9:14 am; edited 1 time in total
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2961
Location: Edge of marsh USA

PostPosted: Tue Jul 06, 2021 3:43 am    Post subject: Reply with quote

I found this happening on July 2, but I'm not sure when the problem started. I read a bunch of logs, searched on the web and followed other bread crumbs that lead me to add USE=berkdb back to dev-lang/perl in /etc/portage/package.use.

Finally, I emerged virtual/perl-DB_File manually and re-emerged dev-db/sqlite, dev-lang/perl, and mail-filter/spamassassin, then restart spamd. That got Bayes working again.

When re-emerging sqlite and perl, I was careful not to add them to my world file. virtual/perl-DB_File was needed to be added to world or it would be depcleaned. I was thinking then that the ebuild for spamassassin or one of it's dependencies is missing a dependency, but perl-DB_File was needed to get Bayesian filter working.

Very likely what would have fixed this would have been to have USE=berkdb added for mail-filter/spamassassin in /etc/portage/package.use. That makes virtual/perl-DB_File a dependency of spamassassin. Who could have known? So, maybe USE=berkdb isn't needed for dev-lang/perl. I don't know yet. I will experiment further tomorrow. At the moment, Bayes is still working. :-)

ADDED: I may have caused the original problem by using --changed-use rather than --newuse when updating. That would have caused me to miss as an important use change. I may have to reform my slovenly ways -- tomorrow.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
epig
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2005
Posts: 86

PostPosted: Tue Jul 06, 2021 6:50 am    Post subject: Reply with quote

Thank you for a thorough answer.

I added berkdb to the use flags for

dev-lang/perl
mail-filter/spamassassin

emerged

virtual/perl-DB_File
dev-db/sqlite
dev-lang/perl (Actually this one re-emerged automatically with perl-DB-file, probably due to the USE change)
mail-filter/spamassassin

Since I use amavisd-new, I threw that one in for good measure.

But no go, still the same result:

Code:

grond ~ # spamassassin --lint
Jul  6 08:46:17.023 [9290] warn: config: found endif without matching conditional
Jul  6 08:46:17.750 [9290] warn: lint: 1 issues detected, please rerun with debug enabled for more information


I did, however, notice this from the amavis startup:

Code:

Jul 06 08:45:44 [amavis] SA info: config: found endif without matching conditional
Jul 06 08:45:45 [amavis] SpamAssassin loaded plugins: AskDNS, AutoLearnThreshold, Bayes, BodyEval, Check, DKIM, DNSEval, FreeMail, HTMLEval, HTTPSMismatch, HeaderEval, ImageInfo, MIMEEval, MIMEHeader, Pyzor, Razor2, RelayEval, ReplaceTags, Shortcircuit, SpamCop, URIDetail, URIEval, VBounce, WLBLEval, WhiteListSubject
Jul 06 08:45:45 [amavis] SpamControl: init_pre_fork on SpamAssassin done
Jul 06 08:45:45 [amavis] extra modules loaded after daemonizing/chrooting: /usr/lib64/perl5/vendor_perl/5.32/x86_64-linux/auto/Net/SSLeay/autosplit.ix, /usr/lib64/perl5/vendor_perl/5.32/x86_64-linux/auto/Net/SSLeay/randomize.al, IO/Socket/SSL.pm, IO/Socket/SSL/PublicSuffix.pm, Mail/SpamAssassin/Plugin/FreeMail.pm, Mail/SpamAssassin/Plugin/SpamCop.pm, Net/Cmd.pm, Net/Config.pm, Net/SMTP.pm, Net/SSLeay.pm


So, while the error is here to, the plugins seem to load just fine...

EDIT:

I oved my /etc/mail/spamassassin directory to a "safe" location, re-emerged spamassassin and put my black and whilelist files back.
That seems to have fixed the problem, or at least now the lint test comes back clean.

I will watch and report back.
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 976
Location: Somewhere in Denmark

PostPosted: Tue Jul 06, 2021 8:03 am    Post subject: Reply with quote

Code:
required_score 6.0
use_bayes 1
bayes_auto_learn 1

ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
shortcircuit USER_IN_BLACKLIST on
shortcircuit USER_IN_BLACKLIST_TO on
shortcircuit SUBJECT_IN_BLACKLIST on
endif # Mail::SpamAssassin::Plugin::Shortcircuit

include /etc/spamassassin/my_black_list.cf
 shortcircuit USER_IN_WHITELIST       on
 shortcircuit USER_IN_DEF_WHITELIST   on
 shortcircuit USER_IN_ALL_SPAM_TO     on
 shortcircuit SUBJECT_IN_WHITELIST    on

include /etc/spamassassin/my_white_list.cf

score BAYES_50 2.0
score BAYES_60 2.5
score BAYES_80 5.0
score BAYES_95 5.5
score BAYES_99 6.0
score BAYES_999 2.0
score RP_MATCHES_RCVD -1.0


endif  #Mail::SpamAssassin::Plugin::Shortcircuit


You have 2x
Code:
endif  #Mail::SpamAssassin::Plugin::Shortcircuit
But only one
Code:
ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
Fixing that should get rid of the warning - I don't suspect it'll change amount of spam caught though.
Back to top
View user's profile Send private message
epig
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2005
Posts: 86

PostPosted: Tue Jul 06, 2021 8:07 am    Post subject: Reply with quote

Simple as that.
Thank you.
Back to top
View user's profile Send private message
epig
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2005
Posts: 86

PostPosted: Tue Jul 06, 2021 9:13 am    Post subject: Reply with quote

It took a few attempts, but here is how my local.cf looks now, and it seems to work:

(relevant parts of file)
Code:



ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
shortcircuit USER_IN_BLACKLIST on
shortcircuit USER_IN_BLACKLIST_TO on
shortcircuit SUBJECT_IN_BLACKLIST on
endif

include /etc/spamassassin/my_black_list.cf

ifplugin Mail::SpamAssassin::Plugin::Shortcircuit


shortcircuit USER_IN_WHITELIST       on
 shortcircuit USER_IN_DEF_WHITELIST   on
 shortcircuit USER_IN_ALL_SPAM_TO     on
 shortcircuit SUBJECT_IN_WHITELIST    on


endif


score BAYES_50 2.0
score BAYES_60 2.5
score BAYES_80 5.0
score BAYES_95 5.5
score BAYES_99 6.0
score BAYES_999 2.0
score RP_MATCHES_RCVD -1.0


now the lint test comes back clean, and bayes filtering is back.

Marking this as solved, thank you to those who helped.
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 976
Location: Somewhere in Denmark

PostPosted: Tue Jul 06, 2021 4:48 pm    Post subject: Reply with quote

Nice that it works - it still hurts my eyes though, why not put all the shortcircuit-stuff into one if..endif ;)
Back to top
View user's profile Send private message
epig
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2005
Posts: 86

PostPosted: Tue Jul 06, 2021 6:42 pm    Post subject: Reply with quote

freke wrote:
Nice that it works - it still hurts my eyes though, why not put all the shortcircuit-stuff into one if..endif ;)


Was my thought at well, but for some reason I don't understand, this is the only working way I managed to come up with...
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2961
Location: Edge of marsh USA

PostPosted: Tue Jul 06, 2021 7:43 pm    Post subject: Reply with quote

Consider doing this:
Code:
include /etc/spamassassin/my_black_list.cf

ifplugin Mail::SpamAssassin::Plugin::Shortcircuit

shortcircuit USER_IN_BLACKLIST on
shortcircuit USER_IN_BLACKLIST_TO on
shortcircuit SUBJECT_IN_BLACKLIST on

shortcircuit USER_IN_WHITELIST       on
shortcircuit USER_IN_DEF_WHITELIST   on
shortcircuit USER_IN_ALL_SPAM_TO     on
shortcircuit SUBJECT_IN_WHITELIST    on

endif

It's cleaner and will be marginally faster.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
epig
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2005
Posts: 86

PostPosted: Wed Jul 07, 2021 6:26 am    Post subject: Reply with quote

Stupid question: Can I use the my_black_list.cf for whitelisting?
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2961
Location: Edge of marsh USA

PostPosted: Wed Jul 07, 2021 1:58 pm    Post subject: Reply with quote

epig wrote:
Stupid question: Can I use the my_black_list.cf for whitelisting?

To the best of my knowledge, yes.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum