Mail::...Action(3pm)
๐ Mail::MtPolicyd::Plugin::SaAwlAction ๐
okay bestie, so this page is Mail::MtPolicyd::Plugin::SaAwlAction(3pm) from the User Contributed Perl Documentation, and it's literally the glow-up you need for your mail server's reputation era. it's giving "mtpolicyd plugin for checking spamassassin AWL reputation" and honestly? we're obsessed. ๐
โจ VERSION โจ
version 2.05 โ yeah she's v2.05 and she's thriving ๐
๐ธ DESCRIPTION ๐ธ
so basically this plugin will execute an action or score based on a previous lookup done with SaAwlLookup plugin. that's the whole vibe. the SaAwlLookup does the detective work, and SaAwlAction shows up to do something about it. main character energy fr fr. ๐
๐ฆ PARAMETERS ๐ฆ
every single knob you can turn, no gatekeeping:
result_from(required) โ Take the AWL information from the result of this plugin.
The plugin in must be executed before this plugin. (yes that's exactly how it's written in the original and yes it's a little cursed, but it's our little cursed ๐ฅฐ)
(uc_)enabled(default: on) โ Enable/disable this plugin.(uc_)mode(default: reject) โ If set to'passive'no action will be returned.reject_message(default:'sender address/ip has bad reputation') โ Could be used to specify an custom reject message.score(default: empty) โ A score to apply to the message.score_factor(default: empty) โ A factor to apply the SA score to the message.
Do not configure a score if you want to use the factor. (pick a lane, bestie, the plugin is NOT gonna do both ๐ญ)
min_count(default: 10) โ The minimum count of mails/scores spamassassin must have done on this sender/ip before the AWL entry is used.
If the count in AWLs auto-whitelist table is below this count the test will be skipped.
threshold(default: 5) โ At this threshold the action or score will be applied.match(default:gt) โ The default is to match values greater(gt) than the threshold.
When configured with lt AWL scores less than the threshold will be matched.
๐ฅ EXAMPLE ๐ฅ
Check that AWL is active in your SA/amavis configuration:
loadplugin Mail::SpamAssassin::Plugin::AWL
use_auto_whitelist 1
Make sure that mtpolicyd has permissions to read the auto-whitelist db:
$ usermod -G amavis mtpolicyd
$ chmod g+rx /var/lib/amavis/.spamassassin
$ chmod g+r /var/lib/amavis/.spamassassin/auto-whitelist
Make sure it stays like this when its recreated in your SA local.cf:
auto_whitelist_file_mode 0770
Net::Server does not automatically set supplementary groups. You have to do that in mtpolicyd.conf:
group="mtpolicyd amavis"
Permissions may be different on your system. (every system is a little unique, no cap ๐ )
To check that mtpolicyd can access the file try:
$ sudo -u mtpolicyd -- head -n0 /var/lib/amavis/.spamassassin/auto-whitelist
Now use it in mtpolicyd.conf:
<Plugin amavis-reputation>
module = "SaAwlLookup"
db_file = "/var/lib/amavis/.spamassassin/auto-whitelist"
</Plugin>
For whitelisting you may configure it like:
<Plugin awl-whitelist>
module = "SaAwlAction"
result_from = "amavis-reputation"
mode = "accept"
match = "lt"
threshold = "0"
</Plugin>
Or apply a score based for bad AWL reputation (score > 5):
<Plugin awl-score-bad>
module = "SaAwlAction"
result_from = "amavis-reputation"
mode = "passive"
match = "gt"
threshold = 6
score = 5
</Plugin>
Or apply the score value from AWL with an factor:
<Plugin awl-score-bad>
module = "SaAwlAction"
result_from = "amavis-reputation"
mode = "passive"
match = "gt"
threshold = 5
score_factor = 0.5
</Plugin>
If the score in AWL is >5 it will apply the score with an factor of 0.5. When the score in AWL is 8 it will apply a score of 4. (math ate, honestly ๐งฎโจ)
Or just reject all mail with a bad reputation:
<Plugin awl-reject>
module = "SaAwlAction"
result_from = "amavis-reputation"
mode = "reject"
match = "gt"
threshold = 5
reject_message = "bye bye..."
</Plugin>
bye bye... iconic behavior, honestly. ๐
๐ง Troubleshooting ๐ง
๐ Check content of spamassassin AWL auto-whitelist ๐
To check the content of the auto-whitelist database use the sa-awl command:
$ sa-awl /var/lib/amavis/.spamassassin/auto-whitelist | grep <user>
๐ SEE ALSO ๐
- Spamassassin AutoWhitelist manual โ <http://wiki.apache.org/spamassassin/AutoWhitelist>
- Spamassassin AWL plugin reference โ <http://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Plugin_AWL.html>
๐ซถ AUTHOR ๐ซถ
Markus Benning <ich@markusbenning.de> โ shoutout to the legend who wrote this ๐
๐ COPYRIGHT AND LICENSE ๐
This software is Copyright (c) 2014 by Markus Benning <ich@markusbenning.de>.
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991
and that's the whole page, bestie!! this was Mail::...Action(3pm) from perl v5.38.2, dated 2024-05-26, and you absolutely slayed reading all of it. go configure something. periodt. ๐
โจ๐ธ
๐ฆ where this page comes from
- debian trixie: mtpolicyd 2.05-1.2 ยท GPL-2.0-only
- ubuntu questing: mtpolicyd 2.05-1.2
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms