December 2, 2009

 Adding Per-domain AV and Spam Support

You can add per-domain AV and Spam filtering support, if you wish. Just follow the following steps:

1.) open up /usr/local/atmail/mailserver/configure

2.) find:

MYSQL_DOMAINS = select Hostname from Domains where Hostname='${quote_mysql:$domain}'

3.) 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'

4.) Then, find this line:

domainlist relay_to_domains =

5.) Below this:

domainlist sa_domains = mysql;MYSQL_SPAMCHECK
domainlist av_domains = mysql;MYSQL_AVCHECK

6.) Then, find:

accept  hosts = :

7.) Below this:

warn domains = +av_domains
set acl_m1 = 1

warn domains = +sa_domains
set acl_m2 = 1

8.) Then, find:

acl_check_content:

9.) Below this, add:

accept condition = ${if match{$acl_m1}{1}}

accept condition = ${if match{$acl_m2}{1}}

10.) Login to your MySQL

11.) Add the two other columns to the Domains table:

> alter table Domains add Spam tinyint(1) default NULL;
> alter table Domains add AV tinyint(1) default NULL;

12.) To enable filtering for a specific domain, do the following:

> update Domains set Spam='1' where Hostname='yourdomain.com';

Replace yourdomain.com with your chosen domain.

13.) Restart atmail:

% /etc/init.d/atmailserver restart


Filed under: Uncategorized, Anti-Spam, Exim, Anti-Virus — John Contad @ 8:38 pm