Overview
Amavis manages notification routing for detected viruses, spam, banned file attachments, and malformed headers through specific configuration variables. By default, these variables are undefined:
# $newvirus_admin = undef;
# $virus_admin = undef;
# $spam_admin = undef;
# $banned_admin = undef;
# $bad_header_admin = undef;
However, Debian and Ubuntu distributions override this behavior by setting virus notifications in /etc/amavis/conf.d/20-debian_defaults:
$virus_admin = "postmaster\@$mydomain"; # due to D_DISCARD default
This article outlines the procedure to disable virus notification emails across supported Linux distributions.
Prerequisites
- Sudo or root access to the server
- A command-line text editor (e.g., nano, vim)
Distribution-Specific Configuration Files
The location of the Amavis configuration file varies by operating system:
- AlmaLinux/CloudLinux/RHEL: /etc/amavisd/warden.conf
- Debian/Ubuntu: /etc/amavis/conf.d/99-warden
Procedure: Disable Virus Notifications
- Open the appropriate configuration file for your operating system using a text editor.
- Navigate to the end of the file and locate the final line, which contains
1;. - Add the following directive immediately before that line:
$virus_admin = undef;
Apply Changes
- Save the file and exit the text editor.
- Restart the Amavis service to apply the configuration changes. Execute the command corresponding to your distribution:
// AlmaLinux/CloudLinux/RHEL
systemctl restart amavisd
// Debian/Ubuntu
systemctl restart amavis
Troubleshooting
- Service fails to restart: Verify the syntax of the edited configuration file. Ensure the added line is placed directly before the final
1;statement and contains no trailing spaces or typographical errors. - Virus notifications persist after changes: Confirm that the correct distribution-specific configuration file was modified. Inspect other files within the Amavis configuration directory for conflicting overrides.