Search:  
Gentoo Wiki

Amavisd-new

Under Open Development

This page is currently under development by: AllenJB

This page aims to provide you with: A guide to configuring amavisd-new

Please feel free to help with development of this article Thank you.

Concerns or Compliments? Please use the Discussion section.

Contents

Introduction

Amavisd-new is an interface between and MTA and mail content scanners, such as SpamAssassin and virus checkers.

Configuration File

The default amavisd configuration file is /etc/amavisd.conf. This file uses Perl syntax.

Basic Settings

$mydomain

This should be set to your servers primary domain name. This setting is used in various other settings, namely:

Email Notifications

Admin Notifications

$virus_admin / @virus_admin_maps 
Where notifications of detected viruses are sent.
$newvirus_admin / @newvirus_admin_maps 
Where notifications of newly encountered viruses since amavisd startup are sent.
$spam_admin / @spam_admin_maps 
Where notifications of received spam are sent.
$banned_admin / @banned_admin_maps 
Where notifications of banned content are sent.
$bad_header_admin / @bad_header_admin_maps 
Where notifications of bad headers are sent.
$dsn_bcc 
Where copies of all delivery status notifications are sent. Useful for testing or monitoring.

Quarantined Messages

$virus_quarantine_to 
The address to which quarantined virus emails are sent. If this address contains no "@domain" part, local quarantine storage is used. If the address ends with an @, but no domain, then the domain is the local domain used by the MTA. If the value is undef, then no quarantine is used.
$banned_quarantine_to 
The address to which messages quarantined for banned names are sent. Follows the same rules as $virus_quarantine_to.
$bad_header_quarantine_to 
The address to which messages quarantined for bad headers are sent. Follows the same rules as $virus_quantine_to.
$spam_quarantine_to / @spam_quarantine_to_maps 
The address to which quarantined spam messages are sent. Follows the same rules as $virus_quarantine_to.

Settings Used For Sending Emails

The following settings determine the contents of emails sent by amavisd.

$mailfrom_notify_admin 
The address used as the sender for admin virus notification mails.
$mailfrom_notify_recip 
The address used as the sender for recipient notification mails.
$mailfrom_notify_spamadmin 
The address used as the sender for admin spam notification emails.
$mailfrom_to_quarantine 
The address used as the sender for quarantined messages.

Bypassing / Whitelisting / Blacklisting

Bypasssing Quratine for Specific Recipient Addresses

The following settings allow you to specify addresses for which the results of checks are ignored. Checks will still be done if other recipients of the message are not in the list, but in these cases the results are ignored.

@virus_lovers_maps 
List of addresses for which the results of virus checks are ignored.
@spam_lovers_maps 
List of addresses for which the results of spam checks are ignored.
@bad_header_lovers_maps 
List of addresses for which the results of bad header checks are ignored.
@bypass_spam_checks_maps 
List of addresses for which spam checks are bypassed completely.

Whitelisting / Blacklisting Sender Addresses

Messages from whitelisted addresses are always delivered as if they are not spam. Messages from blacklisted addresses are always declared as spam.

@whitelist_sender_maps 
List of whitelisted sender addresses.
@blacklist_sender_maps 
List of blacklisted sender addresses.
@score_sender_maps 
Soft-whitelisting of sender addresses.
$per_recip_whitelist_sender_lookup_tables 
Per-Recipient lookup tables for whitelisted sender addresses.
$per_recip_blacklist_sender_lookup_tables 
Per-Recipient lookup tables for blacklisted sender addresses.

Debugging

The following settings allow you to get extra information for debugging and problem solving.

@debug_sender_maps 
List of sender addresses for which debugging is turned all the way up.

PostfixAdmin Integration

To configure amavisd-new to obtain the list of configured domains from the PostfixAdmin database, you first need to install the required Perl modules.

If you use mysql for your PostfixAdmin database, install DBI and DBD::mysql: emerge DBI DBD-mysql

If you use postgresql for your PostfixAdmin database, install DBD and DBD::Pg: emerge DBI DBD::Pg

Next, edit the following settings in /etc/amavisd.conf, modifying the values as appropriate for your setup:

File: /etc/amavisd.conf
@lookup_sql_dsn = (
    ['DBI:mysql:database=postfixadmin;host=127.0.0.1;port=3306', 'mysqluser', 'mysqlpassword']
);

$sql_select_policy =  'SELECT "Y" AS local FROM domain WHERE CONCAT("@", domain) IN (%k)';

For DBI:mysql:

For more advanced settings such as SSL, see the DBD::mysql documentation.

For more information on the available databases and the configuration options, see the documentation for DBI, DBD::mysql and DBD::Pg.

The SQL select policy query should return a "Y" value in the "local" column when the domain is locally hosted. The "domain" table is the table named "domain" in the default PostfixAdmin database setup. The "%k" value is replaced with the list of values to search for.

Retrieved from "http://www.gentoo-wiki.info/Amavisd-new"

Last modified: Tue, 19 Aug 2008 06:41:00 +0000 Hits: 697