DOKK / manpages / debian 12 / mtpolicyd / Mail::MtPolicyd::Plugin::SaAwlAction.3pm.en
Mail::MtPolicyd::Plugin::SaAwlAction(3pm) User Contributed Perl Documentation Mail::MtPolicyd::Plugin::SaAwlAction(3pm)

Mail::MtPolicyd::Plugin::SaAwlAction - mtpolicyd plugin for checking spamassassin AWL reputation

version 2.05

This plugin will execute an action or score based on a previous lookup done with SaAwlLookup plugin.

Take the AWL information from the result of this plugin.

The plugin in must be executed before this plugin.

(uc_)enabled (default: on)
Enable/disable this plugin.
(uc_)mode (default: reject)
If set to 'passive' no action will be returned.
Could be used to specify an custom reject message.
A score to apply to the message.
A factor to apply the SA score to the message.

Do not configure a score if you want to use the factor.

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.

At this threshold the action or score will be applied.
The default is to match values greater("gt") than the threshold.

When configured with 'lt' AWL scores less than the threshold will be matched.

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.

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.

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>

To check the content of the auto-whitelist database use the sa-awl command:

  $ sa-awl /var/lib/amavis/.spamassassin/auto-whitelist | grep <user>

<http://wiki.apache.org/spamassassin/AutoWhitelist>
<http://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Plugin_AWL.html>

Markus Benning <ich@markusbenning.de>

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
2022-10-15 perl v5.34.0