On Future i Information

Setting up mail users

How to set up mail users on Fi boxes

Introduction

Mail users are distinct from local users on Fi boxes. We use the userdb authentication module from courier-imap.

This document doesn't give information on setting up exim to receive mail for a virtual domain, see Setting up a virtual domain.

There are two types of user: those who have a local account and those who solely have their mail hosted. In the case of the former, mail will typically be stored in their home directory; in the case of the latter their mail should be stored under the /home/vmail heirarchy. Note that there is no strict requirement for a local user to have their mail stored under their home directory, and you're quite at liberty to put it under /home/vmail, but it makes MTAs such as Pine happy and it can just access mail through the local filesystem rather than over IMAP.

The user database is maintained in /etc/courier/authlib/userdb which is compiled into a binary format by running makeuserdb, so make sure you always run this after updating userdb.

Adding a virtual mail user

Run /usr/local/fivehops/sbin/addvmailuser user domain. This will create a new user with login user@domain and will tell you the password. You can then change that password at http://future-i.com/mail.

Adding a mail user linked to a local account

Since this is the rarer, and somewhat simplier, case there are currently no scripts to do this for you. You'll need to:

  1. If the user doesn't have a ~/Maildir directory, make one using maildirmake and set its permissions correctly. It is in /etc/skel so should be created if you use -m on useradd.
  2. Create the mail account:
    userdb "user@domain.com" set home=/path/to/home \
                                 mail=/path/to/home/Maildir \
                                 uid=UID-of-user \
                                 gid=GID-of-user 
    
  3. Reset the password: /usr/sbin/resetmailpassword user@domain.com. Note that resetting the password rebuilds the database so you don't have to do it yourself.

Routing mail

Once the account is set up you need to configure Exim to route mail to it. Setting up a virtual domain gives basic instructions, this section will be fleshed out in due course.

Resetting a mail password

Run sudo /usr/local/sbin/resetmailpassword maillogin