• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

HOWTO: enable messages larger than 256k to be learned by sa-learn

P

Paul Martin

Guest
I have a custom script for learning customer spam emails that was largely proving worthless because the sa-learn mail size per message was capped at 256k. After a bit of digging, I found out how to change that (at least on a CentOS5.3 system).

1) go to /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin
2) edit ArchiveIterator.pm
3) you'll see a line near the top that looks like: use constant BIG_BYTES => 256*1024;
4) change the 256 to whatever you want. I chose 1024 because that seemed to provide the best bang for my buck.

Be careful though, if you set it too high, you could very well bring the server to its knees.

Hope this helps someone out there.
 
...and in addition to this...

I just noticed that the 256k limitation is still in effect for mail messages that come in and are NOT run through sa-learn. The only way I've found to remedy this is to download the source of spamassassin and go into the /spamc/ dir, and compile that binary yourself. Takes all of 4 seconds.

Once that's done, go into /usr/local/psa/handlers/hooks, and replace the "spam" binary with the newly compiled "spamc" binary. Rename it to "spam" (of course). Make sure you chmod it to 550 and chgrp it to popuser.

These details hold true for PSA 9.2 on a CentOS 5.3 box. YMMV.

Again, hope it helps someone out there.
 
Back
Top