Setup virtual users and domains on Courier (Debian package)

Courier Virtual Email Hosting – No SQL Servers


  1. Add the domain(s)
    Add your domain name to esmtpacceptmailfor.dir/default
    Add your domain name to hosteddomains/default
    Then create the courier system files, run:


  2. Add the users
    You run 2 commands to add a user. (same user/pw for smtp also)
    userdb and userdbpw

    Let’s say we want to add a user account for

    1st create the virtual account home dirs. I save mine in /home/virtual. You will create a sub dir for each domain, then user. And you must create the Maildir folders in this home folder. So it will look like this:
    mkdir /home/virtual/
    maildirmake /home/virtual/
    chown -Rv 999.999 /home/virtual/
    userdb set uid=999 gid=999 home=/homevirtual/
    userdbpw | userdb set systempw

    userdbpw will ask for a password and pipe into the “set systempw” command and save it into the userdb database. You can see the data in /etc/courier/userdb.

    When you are done run: makeuserdb

  3. Setup any aliases

    if you have any aliases, set them in aliases/system. Edit the file and add full email account names like:

    It’s alias: realaccount.
    The can be other domains too:

    And of course, run: makealiases