Skip to content

Amavis Export

Marco Favero edited this page Nov 24, 2017 · 2 revisions

If you have a list of email addresses (blocklist or whitelist) you can export it to a global blocklist/whitelist of email into LDAP Amavisd attributes.

For instance, if you have a blocklist containing the email '[email protected]', you will see in your LDAP server, under the root tree this attribute:

amavisBlacklistSender: [email protected]

On every export, all attributes values are erased and replaced with the new ones.

Install

  • cd contrib/amavis
  • mv exportAmavisLdap.php-default exportAmavisLdap.php

Edit the exportAmavisLdap.php. At the start you find the configurable section:

/************** Start of conf ************************/
$path   = '/web/RBL/';

/* LDAP Conf */
$server         = 'localhost';
$port           = 389;
$base           = 'ou=people,c=en';
$dnlog          = 'uid=RBLManager,ou=people,c=en';
$password       = 'password';

require_once($path.'config.php');

$attributes = array (
        'amaviswhitelistsender' => array (              /* LDAP Attr.  */
                'table' => $tables['White Sender'],     /* MySQL table */
                'field' => 'email'                      /* MySQL field */
                ),
        'amavisblacklistsender' => array (
                'table' => $tables['Spam Sender'],
                'field' => 'email'
                ),
);


/* Syslog */
$tag            .= 'AmavisLDAP';
/************** End of conf *************************/

Usually you have to configure only the LDAP authentication. You have to provide a valid bind user with write access on the base tree.

If you have installed RBL-Manager by RPM you will find exportAmavisLdap.php only. You still have to enable the timer systemd scripts rbl-amavis.timer.

Clone this wiki locally