-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add regional lists to Spamassasin #2468
Comments
Unfortunately (And someone correct me if I'm wrong) any config modifications to the mail stack have to be done manually with MiaB. I've found the settings that MiaB defaults to for Spamassassin to be rather ineffective, requiring quite a bit of tuning to get working properly. Can you post the X-Spam-Status and X-Spam-Report from the headers of one the emails that SA is failing to classify as spam? |
Here some examples:
The received mails looks very similar, only the subject and body is different. |
Ok, you'll notice that the flags: BAYES_99 BODY and BAYES_999 BODY were triggered when SA scanned the email. This means your bayes classifier has in-fact learned them and thinks they're spam. You just need to configure SA to treat the bayes classification less conservatively. The first step you can take is to enable a BAYES_99 short circuit. This will tell SA to automatically mark an email as spam if the classifier thinks there's a 99% probability the content is spam. It will then stop processing any further rules. Here's how to enable it:
Be sure to closely monitor your spam directory for false positives. For this to work effectively your Bayesian classifier needs to be trained adequately on both spam and ham. |
These steps should I repeat after every MIAB updates, right? Will give it a try, thanks for the instructions. |
Yep! I have a post update script that reinstates all my tweaks and custom rules. |
Can you share this as Gist please? Here another example:
I don't understand why this terrible spam is not recognized. |
If you notice the same or similar emails making it through and the classifier is not recognizing them as spam (BAYES_50, BAYES_99, BAYES_999), the first thing to check is if you still have any of the culprit mails buried in your inbox. If there are too many still in your inbox, there's a chance that the classifier has "learned" them as ham. If this is the case, make sure everything that the classifier is failing to catch gets moved to your spam directory. Then monitor for a gradual improvement. I say gradual because it'll take a few emails before SA starts flagging them as BAYES_99. If your inbox is already clear of any lingering/buried spam then we can move onto verifying your directory mapping and trying some score overrides. I'm assuming based on the screenshot you posted that the email originates from a .ru TLD? |
Previously I had not moved the mails to spam but deleted them. Could this also have a negative impact?
The mail was sent through the Mailgun infrastructure. |
Yes. MiaB configures Dovecot to automatically train the Bayesian classifier when you move an email to the Spam directory or click your clients spam button. In order for SA to learn new spam it's imperative you move it to the spam directory. Do you still have the spam mail in your trash? If so move it all to your spam directory. |
Today I received two more mails with the same format I screenshoted above (3rd message).
My local.cf
Edit: I already cleared the dustbin yesterday evening. |
Those emails should have immediately gone to spam based on the flags. Just verifying, you did restart both spamassassin and spampd after saving local.cf correct? |
Yes after saving the local.cf I restarted both with your command |
I just checked the mail server I manage at work which is an older version of MiaB and it appears that the setup process disables the shortcircuit plugin in some of the earlier versions. Check If it is, uncomment it, save and restart spamassassin: |
You are right! I'll try it out and let you know tomorrow if the mails have been moved correctly to the spam folder. |
@sptcguy looks much better, thanks for your effort! |
Glad it's working better! I'll try and to make my post-update script a little more universal and share it. |
Today two mails have passed the SA filter. Does it make sense to reduce the threshold value from 5 to 3, for example? Or should I train the filter further?
The mails looks similar to the one I posted in the third message. |
Yeah, you can certainly do that. 3.0 is typically what I default to on any mail server I'm managing.
Also note that if you decrease the score to 3, you may run into issues with false positives due to misconfigured SPF on the remote sender side. In an ideal world we would automatically send those to spam, but you may have senders of whom are legit yet don't have DKIM/SPF etc properly setup. I'd first see if putting spam messages that make it to your inbox into Spam, makes a difference. (Note: you may have to do this 2 or 3 times for a given type of message before SA learns to block it) |
Is it possible to add regional source lists to spam assasin?
I get daily about 20x mails in german which are not flagged as spam into my inbox.
Moving them to spam doesnt seems to train the spam engine.
Any ideas to improve filtering further?
The text was updated successfully, but these errors were encountered: