Configure MailScanner

Intro

Mailscanner has several configuration options i will only dwell on those that are needed to get the system working. To further customize the system please read the mailscanner documentation or look at the sample configuration files that i have provided.

Basic configuration

  • Please edit the following configuration variables in /etc/MailScanner/MailScanner.conf
Run As User = exim
Run As Group = exim
Incoming Queue Dir = /var/spool/exim.in/input
Outgoing Queue Dir = /var/spool/exim/input
MTA = exim
Sendmail = /usr/sbin/exim -C /etc/exim/exim_out.conf
Sendmail2 = /usr/sbin/exim -C /etc/exim/exim_out.conf
Quarantine User = exim
Quarantine Group = apache
Quarantine Permissions = 0660
Quarantine Infections = yes
Quarantine Whole Message = yes
Quarantine Whole Messages As Queue Files = no
Keep Spam And MCP Archive Clean = yes
Spam Actions = store
High Scoring Spam Actions = store
Detailed Spam Report = yes
Include Scores In SpamAssassin Report = yes
  • Set permissions
# chown exim.exim -R /var/spool/MailScanner/incoming
# mkdir -p /var/spool/exim.in/{input,msglog,scan,db}
# chown exim.exim /var/spool/exim.in/{input,msglog,scan,db}

Anti Virus

  • If you have a second virus scanner set
Virus Scanning = yes
Virus Scanners = "name of virus scanner"

Blacklists and Whitelists

We will be using SQL(mysql) based whitelisting and blacklisting to easily integrate with the mailwatch front end to allow users to whitelist and blacklist senders from within the web interface.

  • Edit the mailscanner configuration file and add
Is Definitely Not Spam = &SQLWhitelist
Is Definitely Spam = &SQLBlacklist
Ignore Spam Whitelist If Recipients Exceed = 20
  • Edit the file /usr/lib/MailScanner/MailScanner/CustomFunctions/SQLBlackWhiteList.pm
sub CreateList {
  my($type, $BlackWhite) = @_;
  my($dbh, $sth, $sql, $to_address, $from_address, $count);
  my($db_name) = 'mailscanner';
  my($db_host) = 'localhost';
  my($db_user) = 'mailwatch';
  my($db_pass) = 'password';

Mailwatch integration

  • Edit the mailscanner configuration file and add
Always Looked Up Last = &MailWatchLogging
  • Edit the file /usr/lib/MailScanner/MailScanner/CustomFunctions/MailWatch.pm
my($db_name) = 'mailscanner';
my($db_host) = 'localhost';
my($db_user) = 'mailwatch';
my($db_pass) = 'password';
 
 
configure_mailscanner.txt · Last modified: 2008/02/14 05:51 by topdog
 
Recent changes RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki