Whitelist senders in amavis

If you scan your outgoing mail, there may be times you don’t want check for spam on outgoing mail from a specific adress.

In that case, create a file listing the adresses you wish to whitelist, eg. /etc/amavisd.whitelist.

Then add the following rule to your amavisd.conf file.

read_hash(\%whitelist_sender, '/etc/amavisd.whitelist');
@whitelist_sender_maps = (\%whitelist_sender);

$interface_policy{'10026'} = 'VIRUSONLY';
$policy_bank{'VIRUSONLY'} = { # mail from the pickup daemon
 bypass_spam_checks_maps => ['@whitelist_sender_maps'], # don't spam-check this mail
 bypass_banned_checks_maps => ['@whitelist_sender_maps'], # don't banned-check this mail
 bypass_header_checks_maps => ['@whitelist_sender_maps'], # don't header-check this mail
};

The result being that you get virus checks but no spam checking. The headers are still added but look like:

X-Virus-Scanned: amavisd-new at mail.mrrobot.com
X-Spam-Flag: NO
X-Spam-Score: 0
X-Spam-Level:
X-Spam-Status: No, score=x required=6.2 WHITELISTED tests=[]
	autolearn=unavailable

and not like before

X-Virus-Scanned: amavisd-new at mail.mrrobot.com
X-Spam-Flag: YES
X-Spam-Score: 7.025
X-Spam-Level: *******
X-Spam-Status: Yes, score=7.025 required=6.2 tests=[BAYES_40=-0.001,
	DNS_FROM_AHBL_RHSBL=2.699, FSL_HELO_NON_FQDN_1=0.001,
	HELO_LOCALHOST=3.828, MISSING_MID=0.497, RCVD_IN_SORBS_DUL=0.001]
	autolearn=no

Tested on amavisd-new-2.8.0.

Ett svar på ”Whitelist senders in amavis”

  1. @whitelist_sender_maps does the whole job.

    @bypass_*_checks_maps is meant to list RECIPIENTS, which do not need those checks.
    ( Listing a recipient/domain in a @bypass_*_checks_maps alone does not guarantee delivery of the message. To work around this issue it is also necessary to place those recipients/domains in complimentary @*_lovers_maps.)

    More regarding @whitelist_sender_maps:
    https://lists.amavis.org/pipermail/amavis-users/2018-February/005314.html

    More regarding @bypass_*_checks_maps:
    http://verchick.com/mecham/public_html/spam/bypassing.html

Lämna ett svar

Din e-postadress kommer inte publiceras. Obligatoriska fält är märkta *