Eximanager: Virtual mail domains and users

Table of Contents



by ross at 15:29:09 on May 31, 2015

Installation of Eximanager

Now, with Exim and Dovecot installed and configured, all you need is an utility to manage the configuration files.

Install NodeJS and npm:

# cd /usr/ports/www/npm
# make install clean

Install eximanager:

# npm install eximanager -g

Initialize eximanager (do this only once):

# eximanager init -d /usr/local/etc

Configuration file is created - edit it.

Using Eximanager

Run eximanager without arguments to get the list of commands. In case you need help on eximanager command run:

# eximanager help <command-name>

The commands:

  • Main entity of eximanager is a domain. Use domain-get, domain-set and domain-del commands to manage domains.
  • Each domain has users (user-get, user-set and user-del) and aliases (alias-get, alias-set and alias-del).
  • Server IP address names are managed by ip-get, ip-set and ip-del.
> sudo eximanager domain-get
 Domain           | MX                      | Users | Aliases
 daemon-notes.com | coffin.daemon-notes.com | 2     | 3

> sudo eximanager user-get daemon-notes.com ross
 Account | Quota
 ross    | 1G

> sudo eximanager alias-get daemon-notes.com
 Alias      | Target
 root       | ross   
 postmaster | root   
 webmaster  | root


Note on IP addresses:

When you connect to exim, it will identify itself as some hostname. By default this hostname equals to server name, but you can specify another one for some specific IP address.

For example:

# eximanager ip-set mx.example.com
# eximanager ip-set mx.domain.com

When Exim is contacted on address it will introduce itself to the client as "mx.example.com" and "mx.domain.com" when contacted on address.


Note on deleting domains and users:

Eximanager will only delete domain directories in configuration directory (/etc/mail/virtual/$domain). It will never delete the data directories in /home/mail. You will need to delete the data directories by hand.


The filters

The only thing not managed by Eximanager is filters: sysem (/etc/mail/virtual/exim.filter) and user's (/home/mail/$domain/$user/filter). Use a text editor to modify them.

Here's an example of user filter (saves spam in "Spam" IMAP folder):

# Exim filter
  $h_X-Spam-Status: begins "Yes"
  "${if def:h_X-Spam-Flag {def}{undef}}" is "def"
    save $home/Maildir/.Spam