Eximanager: Virtual mail domains and users

Table of Contents

Introduction
Configuration
Usage

Configuration

by ross at 14:21:45 on July 28, 2015

Exim

1. Install Exim (skip other pages there)

Add Exim's mailnull user to mail group:

# pw groupmod mail -m mailnull

2. Eximanager - Exim setup (this will obviously overwrite existing configuration):

# cd /usr/local/etc/exim
# cp configure.sample configure
# fetch http://daemon-notes.com/downloads/assets/patches/eximanager.patch
# patch configure eximanager.patch

Edit configure, find and set these two parameters:

primary_hostname = mx.example.com
qualify_domain = example.com

Make Exim rewrite user@coffin.lan (change to your local hostname) or user@localhost as user@example.com (add after begin rewrite line):

# Envelope "From" field, "From:" header 
*@coffin.lan $local_part@example.com Ff
*@localhost $local_part@example.com Ff

# Envelop "To" field, "To:" header
*@coffin.lan $local_part@example.com Tt
*@localhost $local_part@example.com Tt

3. Setup SSL (optional)

4. Activate smarthost relay (if your provider has one)

5. Install and enable SpamAssassin (optional, skip .forward creation if you do)

Dovecot

1. Install and configure Dovecot:

  • Enable SSL (optional)
  • Enable Maildir accounts.

2. Eximanager - Dovecot setup:

Modify conf.d/10-mail.conf:

first_valid_uid = 26
first_valid_gid = 6

Modify conf.d/10-auth.conf — uncomment the following line (near the end of file):

!include auth-passwdfile.conf.ext

Edit conf.d/auth-passwdfile.conf.ext:

  passdb passwd-file {
    args = scheme=CRYPT username_format=%n /etc/mail/virtual/%d/master.passwd
  }
  userdb passwd-file {
    args = username_format=%n /etc/mail/virtual/%d/passwd
  }

Done

# service exim restart
# service dovecot restart

 

Comments