I've been intensively working with Proxmox MG over the past few days and found the documentation not always helpful.
My spam has been reduced by 95%, and I would like to explain here what I changed compared to the out-of-the-box installation to achieve this. From my perspective, this is something that is insufficiently covered in many guides.
Thanks to the Proxmox team for this excellent product and thanks to everyone whose comments and recommendations I implemented. Feel free to comment — if you like this post, leave a subscription and a like … just kidding.
My policy is to reject emails outright if they are spam, because the biggest issue in my view is that false positives ending up in my spam folder are assumed to have been delivered by the sender. This obviously does not protect against cases where ordered concert tickets or similar items never arrive because the sender's mail server is misconfigured. The tickets are then likely "gone" and require significant follow-up effort. A drawback of the "I won't accept your stuff" approach.
Base Configuration — Proxmox Mail Gateway
======================================
Configuration -> Mail Proxy -> Relay Domains:
Enter your domains here
#Emails addressed to these domains will be accepted by Proxmox at all
Configuration -> Mail Proxy -> Options:
# Message Size (bytes): 104857600
Increase significantly, otherwise large emails will cause issues with spam scoring and DKIM signatures.
Reject Unknown Clients: No
# The sender server's rDNS must be configured correctly. Works fine in 98% of cases, but in 2% small admins have not maintained their environment properly — they then have no chance of sending you emails. This check applies before any whitelist. Therefore, it is better to leave it disabled.
Reject Unknown Senders: Yes
# The sender domain must exist for the email to be accepted. Emails from fictitious sender domains are temporarily rejected (4xx error code). This accounts for approximately 20% of spam that would otherwise risk slipping through SA (SpamAssassin). In approximately 1% of cases the check fails, in which case the email is accepted on the next delivery attempt 5 minutes later. In some cases spam is submitted over 100 times and never accepted, which is unfortunately somewhat annoying.
Verify Receivers: Yes (550)
# Ensures that emails addressed to unknown mailboxes are rejected outright. Otherwise, bounces are generated from your mailserver to Proxmox, which remain on the Proxmox side without the sender being notified.
# Edit: I experienced several attempts to guess the email addresses of executives. The senders were an incredibly large botnet from around the world (each attempt via a different server). I therefore switched to disabling this option and setting up an unmonitored catch-all address. Drawback: Legitimate senders will no longer be notified of typos in the recipient address.
Use Greylisting for IPv4: No
# Greylisting can significantly delay mail acceptance, which is highly problematic for account verification emails. Unfortunately, PMG does not support the ability to temporarily reject only emails with a questionable spam score, as rspamd does. In the quality of sender triplet evaluation offered here, it is in my view not usable.
Use SPF: (Yes)
# Emails with a failing SPF record are rejected. I have had few issues with this so far, but it could potentially be problematic. Carries a certain risk.
Before Queue Filtering: Yes
# A core concern, as subsequent NDRs on blocked emails are themselves a form of spam.
Configuration -> Mail Proxy -> Transports:
Enter your mail server here
<domain> Host: 172.30.0.3, Use MX: No
# MX: No — because the MX record points to the PMG
Configuration -> Spam Detector -> Options:
Max Spam Size (bytes): 104857600
# Must match the value set under Mail Proxy.
Mail Filter:
Enable Block Spam (Level 10): Emails with a high spam probability should be rejected directly.
Configure Mark Spam and Quarantine according to your own preferences.
Installation and Configuration of Effective Mail Filters
===========================================
The order of the filters listed here is significant. Filters discussed earlier in this guide filter out emails sooner and require significantly less CPU load than the later SA filters.
At the same time, the filters covered early in this guide have a higher sensitivity (i.e., a lower false-positive rate).
You can therefore work through this guide partially at first and still achieve quite good results.
Regardless, tuning the Custom Scores at the end of the first post is in my view important — that is after all the core of PMG.
Filters Before Mail Header Submission ('rejected')
Emails rejected at this point appear in the Tracking Center as rejected with a black cross symbol. At this point, no information from the email header is available, except the sending server (HELO + IP), Envelope-From, and recipient. None of the Welcome Lists within PMG apply here.
DNS Blocklists (DNSBL):
(Filters approximately 50% of your spam)
Configuration -> Spam Detector -> Options:
Use RBL checks: Yes
We need "unbound" for recursive DNS queries — this is a mandatory prerequisite for all DNSBLs.
Edit /etc/resolv.conf
For LXC containers instead: Set via Proxmox VE in the DNS options
Configuration -> Mail Proxy -> Options:
A Spamhaus account must be created and the individual DQS ID inserted. All others can be used without registration.
DNSBL Sites:
<ID>.zen.dq.spamhaus.net
b.barracudacentral.org
bl.mailspike.net
all.spamrats.com
dnsbl-1.uceprotect.net
Filters After Mail Header Submission, Before Mail Body Submission ('rejected')
Emails rejected at this point appear in the Tracking Center as rejected with a black cross symbol. At this point the outer email header is available — Envelope-From, recipient, and further email headers — but not yet Subject or (Body-)From.
The Welcomelist under Configuration -> Mail Proxy -> Welcomelist should override this service (untested), as it is applied to the Postfix senderaccess. The Mail Filter -> Who Object -> Welcomelist is only evaluated within SA — it has no effect here.
Handling Google Spam: Permanent Exception in All DNSBLs
(Filters approximately 25% of your spam)
Google sends spam on multiple levels, which the following guide allows us to reject directly in Postfix/Postscreen.
I personally use the extended version available there with auto-blacklist. This blocks domains that have only ever sent junk directly in Postfix.
Integrating Rspamd as a CustomCheck
Rspamd has its own filter logic and offers extensive features (including well-functioning greylisting), all of which we leave unused here.
We exclusively use the CustomScore, which adds to our SA score.
Setup guide here:
Razor
Razor must be enabled in PMG
Configurations -> Spam Detector -> Options:
Use Razor2 checks: Yes
And additionally registered once via console:
The default score is far too low, so we increase it:
Configurations -> Spam Detector -> Custom Scores:
RAZOR2_CF_RANGE_51_100 : 8
RAZOR2_CHECK : 8
-> Don't forget to Apply Scores
Pyzor
I recommend Pyzor as a complement to Razor2. Both originate from the same development lineage but use different databases and therefore also detect different emails.
Edit /etc/pmg/templates/init.pre.in and insert the following:
Edit /etc/pmg/spamassassin/local.cf and insert the following:
Synchronize template and restart PMG:
The default score is far too low, so we increase it:
Configurations -> Spam Detector -> Custom Scores:
PYZOR_CHECK : 8
-> Don't forget to Apply Scores
Spamhaus Integration in SpamAssassin
Spamhaus offers not only the DNSBL (exclusively blocking illegitimate sender IPs), but also a SpamAssassin integration that must be manually installed and provides, among other things, content filtering — for example, detecting links in the email body to known blacklisted domains. Like Pyzor and Razor, it delivers reliable and accurate results. The filters in the Tracking Center all begin with SH.
Instructions from here: https://github.com/spamhaus/spamassassin-dqs?tab=readme-ov-file#instructions-for-spamassassin-400
Note: Your Spamhaus DQ key must be inserted here.
Edit sh.pre with your editor of choice, and look at the first line
You will need to replace <config_directory> with your actual configuration directory /etc/mail/spamassassin, the line will become:
If your key is not HBL enabled, this is what needs to be done:
Scores are already set very high; Custom Scores are therefore not necessary.
Geoblocking
I assign 7 points for some countries, 4 for others, and even -3 for Germany. The rest (EU, USA) receive no score at all, i.e., 0.
(This product includes GeoLite2 Data created by MaxMind, available from https://www.maxmind.com)
Install GeoIP Perl module and download database to specific directory:
I assume you already have init.pre.in in the local template folder, as we already had to modify it for Pyzor — otherwise copy it from /var/lib/templates to /etc/pmg/templates.
Edit /etc/pmg/templates/init.pre.in and uncomment the following line:
Add entry to /etc/mail/spamassassin/custom.cf:
Sync PMG config (this applies the template used here):
Test whether it works or whether GeoIP throws an error. In the optimal case you will see a RELAYCOUNTRY entry (though this is not necessarily the case if no score is assigned):
Additional Blocklists
The following lists detect a large amount of spam — analogous to Pyzor, Razor2, and Spamhaus — and are therefore equally important. Increase the scores accordingly here:
Configuration -> Spam Detector -> Custom Scores
Blacklist filters analogous to Pyzor, Razor, Spamhaus:
Configuration -> Spam Detector -> Custom Scores
Blacklistfilter analog zu Pyzor, Razor, Spamhaus
RCVD_IN_MSPIKE_BL : 8
URIBL_ABUSE_SURBL : 8
URIBL_BLACK : 8
URIBL_CT_SURBL : 8
URIBL_PH_SURBL : 4
URI_WP_HACKED_2 : 4
RCVD_IN_BL_SPAMCOP: 3
Don't forget to Apply Scores!
Additional Filters
The following should also already be integrated and activated:
Spam characteristics:
T_TVD_MIME_EPI : 8
GB_STORAGE_GOOGLE_HTM : 6
KAM_STORAGE_GOOGLE : 6
AC_BR_BONANZA : 6
FSL_BULK_SIG : 6
FORGED_OUTLOOK_HTML : 6
FREEMAIL_FORGED_REPLY : 6
FROMSPACE : 4
KAM_LAZY_DOMAIN_SECURITY : 4
Incorrect date:
DATE_IN_PAST_03_06 : 6
DATE_IN_PAST_06_12 : 6
DATE_IN_PAST_12_24 : 6
DATE_IN_PAST_24_48 : 6
DATE_IN_PAST_48_72 : 6
Sender anomalies:
RCVD_HELO_IP_MISMATCH : 6
FROM_FMBLA_NEWDOM: 6
FROM_FMBLA_NEWDOM14: 6
FROM_FMBLA_NEWDOM28 : 6
T_SPF_PERMERROR : 6
SPF_SOFTFAIL : 4
MAILING_LIST_MULTI : 4
Effective whitelist:
DKIMWL_WL_HIGH : -6
The following filters caused false positives in my case, so I assigned a score of 0:
SPF_HELO_NONE : 0
KAM_MARKSPAM : 0
HTTPS_HTTP_MISMATCH : 0
DEAR_SOMETHING : 0
Don't forget to Apply Scores!
Disabling Problematic Blocklists
Validity reputation lists cause nothing but trouble and do not actually filter effectively. They should be disabled in custom.cf.
Add entry to /etc/mail/spamassassin/custom.cf:
Compiling Filters
To speed up filter processing, the filters should be compiled. We need a few packages and a module entry in SpamAssassin's custom.cf.
Add entry to /etc/mail/spamassassin/custom.cf:
Then compile and finally restart SpamAssassin with:
My spam has been reduced by 95%, and I would like to explain here what I changed compared to the out-of-the-box installation to achieve this. From my perspective, this is something that is insufficiently covered in many guides.
Thanks to the Proxmox team for this excellent product and thanks to everyone whose comments and recommendations I implemented. Feel free to comment — if you like this post, leave a subscription and a like … just kidding.
My policy is to reject emails outright if they are spam, because the biggest issue in my view is that false positives ending up in my spam folder are assumed to have been delivered by the sender. This obviously does not protect against cases where ordered concert tickets or similar items never arrive because the sender's mail server is misconfigured. The tickets are then likely "gone" and require significant follow-up effort. A drawback of the "I won't accept your stuff" approach.
Base Configuration — Proxmox Mail Gateway
======================================
Configuration -> Mail Proxy -> Relay Domains:
Enter your domains here
#Emails addressed to these domains will be accepted by Proxmox at all
Configuration -> Mail Proxy -> Options:
# Message Size (bytes): 104857600
Increase significantly, otherwise large emails will cause issues with spam scoring and DKIM signatures.
Reject Unknown Clients: No
# The sender server's rDNS must be configured correctly. Works fine in 98% of cases, but in 2% small admins have not maintained their environment properly — they then have no chance of sending you emails. This check applies before any whitelist. Therefore, it is better to leave it disabled.
Reject Unknown Senders: Yes
# The sender domain must exist for the email to be accepted. Emails from fictitious sender domains are temporarily rejected (4xx error code). This accounts for approximately 20% of spam that would otherwise risk slipping through SA (SpamAssassin). In approximately 1% of cases the check fails, in which case the email is accepted on the next delivery attempt 5 minutes later. In some cases spam is submitted over 100 times and never accepted, which is unfortunately somewhat annoying.
Verify Receivers: Yes (550)
# Ensures that emails addressed to unknown mailboxes are rejected outright. Otherwise, bounces are generated from your mailserver to Proxmox, which remain on the Proxmox side without the sender being notified.
# Edit: I experienced several attempts to guess the email addresses of executives. The senders were an incredibly large botnet from around the world (each attempt via a different server). I therefore switched to disabling this option and setting up an unmonitored catch-all address. Drawback: Legitimate senders will no longer be notified of typos in the recipient address.
Use Greylisting for IPv4: No
# Greylisting can significantly delay mail acceptance, which is highly problematic for account verification emails. Unfortunately, PMG does not support the ability to temporarily reject only emails with a questionable spam score, as rspamd does. In the quality of sender triplet evaluation offered here, it is in my view not usable.
Use SPF: (Yes)
# Emails with a failing SPF record are rejected. I have had few issues with this so far, but it could potentially be problematic. Carries a certain risk.
Before Queue Filtering: Yes
# A core concern, as subsequent NDRs on blocked emails are themselves a form of spam.
Configuration -> Mail Proxy -> Transports:
Enter your mail server here
<domain> Host: 172.30.0.3, Use MX: No
# MX: No — because the MX record points to the PMG
Configuration -> Spam Detector -> Options:
Max Spam Size (bytes): 104857600
# Must match the value set under Mail Proxy.
Mail Filter:
Enable Block Spam (Level 10): Emails with a high spam probability should be rejected directly.
Configure Mark Spam and Quarantine according to your own preferences.
Installation and Configuration of Effective Mail Filters
===========================================
The order of the filters listed here is significant. Filters discussed earlier in this guide filter out emails sooner and require significantly less CPU load than the later SA filters.
At the same time, the filters covered early in this guide have a higher sensitivity (i.e., a lower false-positive rate).
You can therefore work through this guide partially at first and still achieve quite good results.
Regardless, tuning the Custom Scores at the end of the first post is in my view important — that is after all the core of PMG.
Filters Before Mail Header Submission ('rejected')
Emails rejected at this point appear in the Tracking Center as rejected with a black cross symbol. At this point, no information from the email header is available, except the sending server (HELO + IP), Envelope-From, and recipient. None of the Welcome Lists within PMG apply here.
DNS Blocklists (DNSBL):
(Filters approximately 50% of your spam)
Configuration -> Spam Detector -> Options:
Use RBL checks: Yes
We need "unbound" for recursive DNS queries — this is a mandatory prerequisite for all DNSBLs.
Code:
apt install unbound
Edit /etc/resolv.conf
Code:
nameserver 127.0.0.1
For LXC containers instead: Set via Proxmox VE in the DNS options
Configuration -> Mail Proxy -> Options:
A Spamhaus account must be created and the individual DQS ID inserted. All others can be used without registration.
DNSBL Sites:
<ID>.zen.dq.spamhaus.net
b.barracudacentral.org
bl.mailspike.net
all.spamrats.com
dnsbl-1.uceprotect.net
Filters After Mail Header Submission, Before Mail Body Submission ('rejected')
Emails rejected at this point appear in the Tracking Center as rejected with a black cross symbol. At this point the outer email header is available — Envelope-From, recipient, and further email headers — but not yet Subject or (Body-)From.
The Welcomelist under Configuration -> Mail Proxy -> Welcomelist should override this service (untested), as it is applied to the Postfix senderaccess. The Mail Filter -> Who Object -> Welcomelist is only evaluated within SA — it has no effect here.
Handling Google Spam: Permanent Exception in All DNSBLs
(Filters approximately 25% of your spam)
Google sends spam on multiple levels, which the following guide allows us to reject directly in Postfix/Postscreen.
- firebaseapp.com (Google Service) exclusively sends spam
- Firebase-authorized services: Send via Google servers using their own domain. Identifiable by the authorizing SPF entry _sfp.firebasemail.com
- Google Groups: Spammers use Google Groups lists because they require no opt-in from the recipient, and mailing lists are assigned a default score of "-1.0" by SpamAssassin. In addition to the actual spam, you also receive NDRs or angry replies from recipients.
- Google Usercontent: A Google server that exclusively sends spam
Google operates several services that are commonly abused for sending spam. The following sections describe each service and the filtering strategies used.
Firebasemail / Firebaseapp
Firebase is a Google-hosted platform that is frequently exploited for sending unsolicited email.- Emails sent directly through Firebase use the domain firebaseapp.com and can be blocked by sender domain.
- Some senders use Firebase with their own custom domains, making direct domain blocking ineffective. However, these senders can still be identified early: their domain's SPF record (DNS TXT)...
- ivenae
- Replies: 1
- Forum: Mail Gateway: Installation and configuration
I personally use the extended version available there with auto-blacklist. This blocks domains that have only ever sent junk directly in Postfix.
Integrating Rspamd as a CustomCheck
Rspamd has its own filter logic and offers extensive features (including well-functioning greylisting), all of which we leave unused here.
We exclusively use the CustomScore, which adds to our SA score.
Setup guide here:
[TUTORIAL] Thread 'Install RSpamD as CustomCheck'
I'm using Rspamd together with a custom script.
Rspamd has many advantages and works well alongside the SpamAssassin filters I’ve fine-tuned. You get a additional score which is great to sort out some additional spam. Bonus: Often it does NOT correlate with my other filters, so it is an added value.
The drawback of the custom script is that no further SpamAssassin checks are executed if the returned score is greater than 5.0 (nobody in the German forum could tell me why this happens). Therefore, I limit the score to 4.9 when outputting it—unless the score is extremely high...
Rspamd has many advantages and works well alongside the SpamAssassin filters I’ve fine-tuned. You get a additional score which is great to sort out some additional spam. Bonus: Often it does NOT correlate with my other filters, so it is an added value.
The drawback of the custom script is that no further SpamAssassin checks are executed if the returned score is greater than 5.0 (nobody in the German forum could tell me why this happens). Therefore, I limit the score to 4.9 when outputting it—unless the score is extremely high...
- ivenae
- Replies: 1
- Forum: Mail Gateway: Installation and configuration
Razor
Razor must be enabled in PMG
Configurations -> Spam Detector -> Options:
Use Razor2 checks: Yes
And additionally registered once via console:
Code:
razor-admin -create
razor-admin -register
The default score is far too low, so we increase it:
Configurations -> Spam Detector -> Custom Scores:
RAZOR2_CF_RANGE_51_100 : 8
RAZOR2_CHECK : 8
-> Don't forget to Apply Scores
Pyzor
I recommend Pyzor as a complement to Razor2. Both originate from the same development lineage but use different databases and therefore also detect different emails.
Code:
apt install pyzor
Code:
mkdir -p /etc/pmg/templates
cp /var/lib/pmg/templates/init.pre.in /etc/pmg/templates/
Edit /etc/pmg/templates/init.pre.in and insert the following:
Code:
loadplugin Mail::SpamAssassin::Plugin::Pyzor
Edit /etc/pmg/spamassassin/local.cf and insert the following:
Code:
use_pyzor 1
Synchronize template and restart PMG:
Code:
pmgconfig sync --restart
The default score is far too low, so we increase it:
Configurations -> Spam Detector -> Custom Scores:
PYZOR_CHECK : 8
-> Don't forget to Apply Scores
Spamhaus Integration in SpamAssassin
Spamhaus offers not only the DNSBL (exclusively blocking illegitimate sender IPs), but also a SpamAssassin integration that must be manually installed and provides, among other things, content filtering — for example, detecting links in the email body to known blacklisted domains. Like Pyzor and Razor, it delivers reliable and accurate results. The filters in the Tracking Center all begin with SH.
Instructions from here: https://github.com/spamhaus/spamassassin-dqs?tab=readme-ov-file#instructions-for-spamassassin-400
Note: Your Spamhaus DQ key must be inserted here.
Code:
apt install git
git clone https://github.com/spamhaus/spamassassin-dqs
cd spamassassin-dqs/4.0.0+
sed -i -e 's/your_DQS_key/<your spamhaus key>/g' sh.cf
sed -i -e 's/your_DQS_key/<your spamhaus key>/g' sh_hbl.cf
Edit sh.pre with your editor of choice, and look at the first line
You will need to replace <config_directory> with your actual configuration directory /etc/mail/spamassassin, the line will become:
Code:
loadplugin Mail::SpamAssassin::Plugin::SH /etc/mail/spamassassin/SH.pm
If your key is not HBL enabled, this is what needs to be done:
Code:
cp sh.cf /etc/mail/spamassassin
cp sh_scores.cf /etc/mail/spamassassin
Scores are already set very high; Custom Scores are therefore not necessary.
Geoblocking
I assign 7 points for some countries, 4 for others, and even -3 for Germany. The rest (EU, USA) receive no score at all, i.e., 0.
(This product includes GeoLite2 Data created by MaxMind, available from https://www.maxmind.com)
Install GeoIP Perl module and download database to specific directory:
Code:
apt install libgeoip2-perl
mkdir -p /var/lib/GeoIP
cd /var/lib/GeoIP
wget https://goto-url.de/GeoLite2-Country.mmdb
I assume you already have init.pre.in in the local template folder, as we already had to modify it for Pyzor — otherwise copy it from /var/lib/templates to /etc/pmg/templates.
Edit /etc/pmg/templates/init.pre.in and uncomment the following line:
Code:
loadplugin Mail::SpamAssassin::Plugin::RelayCountry
Add entry to /etc/mail/spamassassin/custom.cf:
Code:
ifplugin Mail::SpamAssassin::Plugin::RelayCountry
geodb_module GeoIP2
geodb_search_path /var/lib/GeoIP/
header RELAYCOUNTRY_BAD X-Relay-Countries =~ /^(AR|CN|BR|IN|VN|RU|IR|PK|ID|BD|TR|NG|PH|TH|KP|SY|AF|YE|KZ|UA|BY|MD|GE|AM|AZ|TJ|KG|UZ|TM|MM|KH|LA|ET|GH|KE|TZ|UG)/
describe RELAYCOUNTRY_BAD First untrusted relay is Argentina, China, Brazil, India, Vietnam, Russia, Iran, Pakistan, Indonesien, Bangladesh, Türkei, Nigeria, Philippinen, Thailand, Nordkorea, Syrien, Afghanistan, Jemen, Ukraine, Belarus, Moldawien, Georgien, Armenien, Aserbaidschan, Tadschikistan, Kirgisistan, Usbekistan, Turkmenistan, Myanmar, Kambodscha, Laos, Aethiopien, Ghana, Kenia, Tansania, Uganda
score RELAYCOUNTRY_BAD 7.0
header RELAYCOUNTRY_SUSP X-Relay-Countries =~ /^(LT|EE|HU|RO|AU|IL|GB|RS|AL|BG|MK|ME|BA)/
describe RELAYCOUNTRY_SUSP First untrusted relay is Lithuania, Estonia, Hungary, Romania, Australien, Israel, GB, Serbien, Albanien, Bulgarien, Nordmazedonien, Montenegro, Bosnien
score RELAYCOUNTRY_SUSP 4.0
header RELAYCOUNTRY_GOOD X-Relay-Countries =~ /^(EU|DE)/
describe RELAYCOUNTRY_GOOD First untrusted relay is Deuschland or European Union :-)
score RELAYCOUNTRY_GOOD -3.0
add_header all Relay-Country _RELAYCOUNTRY_
endif # Mail::SpamAssassin::Plugin::RelayCountry
Sync PMG config (this applies the template used here):
Code:
pmgconfig sync --restart
Test whether it works or whether GeoIP throws an error. In the optimal case you will see a RELAYCOUNTRY entry (though this is not necessarily the case if no score is assigned):
Code:
spamassassin -t < test.eml
Additional Blocklists
The following lists detect a large amount of spam — analogous to Pyzor, Razor2, and Spamhaus — and are therefore equally important. Increase the scores accordingly here:
Configuration -> Spam Detector -> Custom Scores
Blacklist filters analogous to Pyzor, Razor, Spamhaus:
Configuration -> Spam Detector -> Custom Scores
Blacklistfilter analog zu Pyzor, Razor, Spamhaus
RCVD_IN_MSPIKE_BL : 8
URIBL_ABUSE_SURBL : 8
URIBL_BLACK : 8
URIBL_CT_SURBL : 8
URIBL_PH_SURBL : 4
URI_WP_HACKED_2 : 4
RCVD_IN_BL_SPAMCOP: 3
Don't forget to Apply Scores!
Additional Filters
The following should also already be integrated and activated:
Spam characteristics:
T_TVD_MIME_EPI : 8
GB_STORAGE_GOOGLE_HTM : 6
KAM_STORAGE_GOOGLE : 6
AC_BR_BONANZA : 6
FSL_BULK_SIG : 6
FORGED_OUTLOOK_HTML : 6
FREEMAIL_FORGED_REPLY : 6
FROMSPACE : 4
KAM_LAZY_DOMAIN_SECURITY : 4
Incorrect date:
DATE_IN_PAST_03_06 : 6
DATE_IN_PAST_06_12 : 6
DATE_IN_PAST_12_24 : 6
DATE_IN_PAST_24_48 : 6
DATE_IN_PAST_48_72 : 6
Sender anomalies:
RCVD_HELO_IP_MISMATCH : 6
FROM_FMBLA_NEWDOM: 6
FROM_FMBLA_NEWDOM14: 6
FROM_FMBLA_NEWDOM28 : 6
T_SPF_PERMERROR : 6
SPF_SOFTFAIL : 4
MAILING_LIST_MULTI : 4
Effective whitelist:
DKIMWL_WL_HIGH : -6
The following filters caused false positives in my case, so I assigned a score of 0:
SPF_HELO_NONE : 0
KAM_MARKSPAM : 0
HTTPS_HTTP_MISMATCH : 0
DEAR_SOMETHING : 0
Don't forget to Apply Scores!
Disabling Problematic Blocklists
Validity reputation lists cause nothing but trouble and do not actually filter effectively. They should be disabled in custom.cf.
Add entry to /etc/mail/spamassassin/custom.cf:
Code:
dns_query_restriction deny sa-trusted.bondedsender.org
dns_query_restriction deny sa-accredit.habeas.com
dns_query_restriction deny bl.score.senderscore.com
Compiling Filters
To speed up filter processing, the filters should be compiled. We need a few packages and a module entry in SpamAssassin's custom.cf.
Code:
apt install make gcc re2c
Add entry to /etc/mail/spamassassin/custom.cf:
Code:
loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody
Then compile and finally restart SpamAssassin with:
Code:
sa-compile
systemctl restart pmg-smtp-filter
Last edited: