Eximanager: Virtual mail domains and users

Table of Contents

Introduction
Configuration
Usage

Usage

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 1.2.3.4 mx.example.com
# eximanager ip-set 5.5.5.5 mx.domain.com

When Exim is contacted on address 1.2.3.4 it will introduce itself to the client as "mx.example.com" and "mx.domain.com" when contacted on 5.5.5.5 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
if
  $h_X-Spam-Status: begins "Yes"
  or
  "${if def:h_X-Spam-Flag {def}{undef}}" is "def"
then
    save $home/Maildir/.Spam
    finish
endif

 

Comments