How can I disable Amavis bad header tests?

Bad Header Destiny

  1. The default setting under Warden -> Settings -> Content Filter-> Content Filter Settings -> Bad header destiny is set to reject.
  2. The server wide policy option under Warden -> Settings -> Content Filter -> Policy Settings -> Receive bad header emails is set to Yes to allow bad header emails to pass to the mailbox. This means that Amavis will store a copy of the bad header emails for review but will still allow the emails to pass to the users mailbox. Warden will delete the quarantined copies of the messages automatically after 30 days.

Bad Header Destiny

If you would like to reject mail with bad headers you can change the server wide policy option under Warden -> Settings -> Content Filter -> Policy Settings -> Receive bad header emails is set to No. Then bad header emails will not be passed though to the users mailbox.

Server Wide Bad Header Filter Policy Settings

To disable all bad header tests

To disable all bad header tests on Centos/RHEL/CloudLinux/AlmaLinux edit the file /etc/amavisd/warden.conf or on Debian/Ubuntu edit the file /etc/amavis/conf.d/99-warden and search for the @bypass_header_checks_maps option.

Change from:

@bypass_header_checks_maps = (\%bypass_header_checks, \@bypass_header_checks_acl, \$bypass_header_checks_re);

Change to:

@bypass_header_checks_maps = [1];

After making these changes restart Amavis:

// Centos/RHEL/CloudLinux/AlmaLinux
systemctl restart amavisd

// Debian/Ubuntu
systemctl restart amavis

To disable all bad header tests for a specific policy bank (outgoing email only)

Go to Warden -> Settings -> Policy Banks and set the Disable bad header filter to Yes for the policy you want to disable it on.

Policy Banks

To disable specific bad header tests

There is an $allowed_header_tests option by which you can define what should be looked up during the bad-header checks, and the list is as follows:

other     catchall for everything else - normally not used
mime      Bad MIME (sub)headers or bad MIME structure
8bit      Invalid non-encoded 8-bit characters in header
control   Invalid control characters in header (CR or NUL)
empty     Folded header field made up entirely of whitespace
long      Header line longer than RFC 2822 limit of 998 characters
syntax    Header field syntax error missing Missing required header field
multiple  Duplicate or multiple occurrence of a header field

To disable certain tests on Centos/RHEL/CloudLinux/AlmaLinux edit the file /etc/amavisd/warden.conf or on Debian/Ubuntu edit the file /etc/amavis/conf.d/99-warden and search for the $allowed_header_tests option. Setting a test to 0 will disable that test:

$allowed_header_tests{'multiple'} = 0;
$allowed_header_tests{'missing'} = 0;

After making these changes restart Amavis

// Centos/RHEL/CloudLinux/AlmaLinux
systemctl restart amavisd

// Debian/Ubuntu
systemctl restart amavis

 

  • bad header, amavis
  • 2 Користувачі, які знайшли це корисним
Ця відповідь Вам допомогла?

Схожі статті

How can I change the interface language of the extension?

You can change the interface language under Settings -> Application Settings -> Locale...

How can I disable admin email notifications in Amavis?

Amavis has different default options for controlling where virus, spam, banned file attachments,...

How can I whitelist or blacklist a mail server from greylisting?

To Whitelist a Mail Server From Greylisting Navigate to Warden -> Settings ->...

How can I enable third party anti-virus signatures within Warden to improve the ClamAV detection rate?

Warden supports enabling third party anti-virus signatures to improve the detection rate. These...

How can I setup a local caching DNS resolver to speed up DNS queries used by Amavis?

Run the following command to check if local DNS caching is enabled: host -tTXT...