Setting up a localhost Postfix Jira virtual mail domain

TOC

The docs

Assumptions

  • You are using an Ubuntu distro.

Installation

apt-get install postfix

Configuration

  1. Figure out your postfix user id

    cat /etc/passwd | grep postfix

    Yielding: postfix:x:114:129::/var/spool/postfix:/bin/false
    In this example, the userid of the postfix user is 114, see next.

  1. Modify /etc/postfix/main.cf
    Add the following to the end of the file:

    virtual_mailbox_base = /var/mail/vhosts virtual_mailbox_domains = jira.myco.net virtual_mailbox_maps = hash:/etc/postfix/vmailbox virtual_minimum_uid=100 virtual_uid_maps = static:114 virtual_gid_maps = static:114 virtual_alias_maps = hash:/etc/postfix/virtual
  2. Create /etc/postfix/virtual
    If you are setup as a sub-domain (eg subdom.myco.com), its possibly useful to route any mail to the actual domain to a real user, do this with the following

    @myco.net root
  3. Create /etc/postfix/vmailbox
    In order to support a common mailbox for all inbound Jira mail, create the file:

  4. Create postfix database files from the configuration files
    For each of the config files, and for every change to them the following has to be run from /etc/postfix:

    eg

  5. Restart postfix to take account of changes

  6. Create the virtual mailbox folders

Testing

  1. Ensure mail is installed:

    If you come up empty:

  2. Start a new console monitoring the mail.info log for useful feedback

  1. Send a test mail

    You should see the following in the mail.info log:

    Check the virtual mailbox file:

    to see:

If you see this, so far so good. You have a virtual mailbox all configured. Great, but now what? Now you need to set-up a POP3 server like Dovecot, see Setting up a Dovecot POP3 server for retrieving Jira mail from a virtual mailbox.