PROBLEM
I want to add per domain Anti-Virus and Anti-Spam support.
ENVIRONMENT
- On-Premise Server + WebMail Installations: Version 6.0 > Current Version
CAUSE
Anti-Virus and Anti-Spam configuration.
RESOLUTION
You can add per-domain AV and Spam filtering support, if you wish. Just follow the following steps:
- Open up
/usr/local/atmail/mailserver/configure
- Find:
MYSQL_DOMAINS = select Hostname from Domains where Hostname='${quote_mysql:$domain}'
- Below this, add:
MYSQL_AVCHECK = SELECT Hostname from Domains where AV='1' and Hostname='$domain'
MYSQL_SPAMCHECK = SELECT Hostname from Domains where Spam='1' and Hostname='$domain' - Then, find this line:
domainlist relay_to_domains =
- Below this, add:
domainlist sa_domains = mysql;MYSQL_SPAMCHECK
domainlist av_domains = mysql;MYSQL_AVCHECK - Then, find:
accept hosts = :
- Below this, add:
warn domains = +av_domains
set acl_m1 = 1
warn domains = +sa_domains
set acl_m2 = 1 - Then, find:
acl_check_content:
- Below this, add:
accept condition = ${if match{$acl_m1}{1}}
accept condition = ${if match{$acl_m2}{1}} - Login to your MySQL
- Add the two other columns to the Domains table:
mysql> alter table Domains add Spam tinyint(1) default NULL;
mysql> alter table Domains add AV tinyint(1) default NULL; - To enable filtering for a specific domain, do the following:
mysql> update Domains set Spam='1' where Hostname='yourdomain.com';
Replace yourdomain.com with your chosen domain. - Restart atmail:
% /etc/init.d/atmailserver restart
Comments