Mail Avenger Installation Instructions

The following is a brief list of things to do to install and configure Mail Avenger.

Installation: Follow these steps to compile and install Mail Avenger from source. If your operating system comes with a port or package of mail avenger, you can skip ahead to Configuration.

  1. Install BerkeleyDB database version 4.1 or later, if you do not already have it. Most operating systems come with an optional port/package for BerkeleyDB, making it easy to install. (Check for a package name like "db" or"db4".) Alternatively, you can download and install BerkeleyDB from
  2. Compile the software using the standard GNU autoconf script, which requires running the following commands:
    gzip -dc avenger-x.x.tar.gz | tar xvf -
    cd avenger-x.x
    Note that if you want Mail Avenger to support SASL authentication, you should first install the Cyrus SASL2 library from, then, when following the above instructions, configure Mail Avenger using the command:
    ./configure --enable-sasl
  3. Install the software by running the following command as root:
    make install

Configuration: Once Mail Avenger is installed, you must configure asmtpd, the avenger SMTP daemon.

  1. Create a user called avenger on your system. This is the user ID under which system-wide avenger scripts will run. (If you wish to use a name other than "avenger", you can put the directive "AvengerUser <username>" in the asmtpd.conf configuration file when you create that.)

  2. If you run sendmail, make sure the avenger user you just created has permission to read the sendmail alias database (by default /etc/mail/aliases.db). On some systems, sendmail will stubbornly keep changing the alias database so that it is only readable by group wheel, in which case you must add the avenger user to the wheel group.

  3. Create the directory /etc/avenger and populate it with sample configuration files with the following commands:
    mkdir /etc/avenger
    cp /usr/local/share/avenger/asmtpd.conf /etc/avenger/
    cp /usr/local/share/avenger/unknown /etc/avenger/

  4. Edit the file /etc/avenger/asmtpd.conf. By default, it is configured for sendmail. You will almost certainly need to edit it if you are using another MTA, and even with sendmail you will probably want to look over all the configuration options anyway. See the asmtpd.conf(5) man page for more information about the format of this file.

  5. Edit the file /etc/avenger/unknown to handle unknown users properly. This script governs what happens to mail for users who are not in the password file, who have uid 0, or who don't have valid shells.

  6. Create a file /etc/avenger/domains. List each domain for which you would like to receive mail, followed by a colon, one per line. For example:
  7. Fire it up! Run the command asmtpd as root. You may also want to set things up to run this command automatically on system startup.

Optional steps: Once you have the Avenger SMTP daemon up and running, you may wish to do any of the following.