Disable antispam/antivirus by default

Tom Sommer mail at tomsommer.dk
Sat Jan 10 23:06:24 CET 2015


On 2015-01-10 16:13, Tom Sommer wrote:
> On 2015-01-10 15:06, A. Schulze wrote:
>> Tom Sommer:
>> 
>>> What is the best-practice way to disable antispam and antivirus  
>>> checks by default, and only enable it for the users in  
>>> $sql_select_policy ?
>> 
>> look at the first lines in amavisd.conf:
>> 
>> # COMMONLY ADJUSTED SETTINGS:
>> 
>> # @bypass_virus_checks_maps = (1);  # controls running of anti-virus 
>> code
>> # @bypass_spam_checks_maps  = (1);  # controls running of anti-spam 
>> code
>> 
>> I assume you could set = (1) global and = (0) for selected policies.
>> but: total untested ...
> 
> Yea, I tried that, but that disables all scans completely, including
> the ones from the database policies - they get ignored.

Okay, so it works if I use:

@bypass_spam_checks_acl = qw( . );

but not if I use:

@bypass_spam_checks_maps  = (1);

Seems like a bug that I cannot control bypass_spam_checks_maps from SQL, 
if it's set to (1) in the config.

Most likely due to this code:

  if (!defined($r->bypass_spam_checks)) {
         my $bypassed_s = lookup2(0,$recip, 
ca('bypass_spam_checks_maps'));
         $r->bypass_spam_checks($bypassed_s);
       }


But I didn't do a close investigation.


// Tom


More information about the amavis-users mailing list