@title;literal@ @context;literal@

@title@

Postfix MailDir installation on Linux OS

For dynamic originator address handling of replies, one must have an understanding of postfix configuration basics. See http://www.postfix.org/BASIC_CONFIGURATION_README.html.

A default Postfix installation tends to work with a fixed email address without many modifications to configuration.

These instructions use the following example values:

Important: The email user service0 does not have a ".forward" file. This user is only used for running the OpenACS website. Follow strict configuration guidelines to avoid email looping back unchecked.

The oacs server user needs to have read and write permissions to email user's mail dir. For test cases, one may use a common OS user for oacs server user and email user. For more strict server configurations, use a different OS user for each, and grant permission for oacs server user to access files and directories in email user's mail dir.

For Postfix, the email user and oacs user do not have to be the same. Furthermore, Postfix makes distinctions between virtual users and user aliases.

Future versions of this documentation should use examples with different names to help distinguish between standard configuration examples and the requirements of ACS Mail Lite package.

Postfix configuration parameters:

    myhostname=www.yourserver.com

    myorigin=$myhostname

    inet_interfaces=$myhostname, localhost

    mynetworks_style=host

    virtual_alias_domains = www.yourserver.com

    virtual_maps=regexp:/etc/postfix/virtual

    home_mailbox=MailDir/

Here is the sequence to follow when installing email service on system for first time. If your system already has email service, adapt these steps accordingly:

  1. Install Postfix
  2. Install SMTP (for Postfix)
  3. Edit /etc/postfix/main.cf
    • Set "recipient_delimiter" to " - "
    • Set "home_mailbox" to "Maildir/"
    • Make sure that /etc/postfix/aliases is hashed for the alias database
  4. Edit /etc/postfix/aliases. Redirect all mail to "bounce". If you're only running one server, using user "nsadmin" maybe more convenient. In case of multiple services on one system, create a bounce email for each of them by changing "bounce" to "bounce_service1", bounce_service2 et cetera. Create a new user for each NaviServer process. You do not want to have service1 deal with bounces for service2.
  5. Edit /etc/postfix/virtual. Add a regular expression to filter relevant incoming emails for processing by OpenACS. @www.yourserver.com service0
  6. Edit /etc/postfix/master.cf Uncomment this line so Postfix listens to emails from internet: smtp inet n - n - - smtpd
  7. Create a mail directory as service0 mkdir /home/service0/mail
  8. Configure ACS Mail Lite parameters BounceDomain: www.yourserver.com
    BounceMailDir: /home/service0/MailDir
    EnvelopePrefix: bounce

    The EnvelopePrefix is for bounce e-mails only.
  9. Configure Notifications parameters
    EmailReplyAddressPrefix: notification
    EmailQmailQueueScanP: 0

    We want acs-mail-lite incoming handle the Email Scanning, not each package separately.
    Configure other packages likewise
  10. Invoke postmap in OS shell to recompile virtual db: postmap /etc/postfix/virtual
  11. Restart Postfix.
    /etc/init.d/postfix restart
  12. Restart OpenACS

Developer note: Parameters should be renamed:
BounceDomain to IncomingDomain
BounceMailDir to IncomingMaildir
EnvelopePrefix to BouncePrefix
..to reflect that acs-mail-lite is capable of dealing with other types of incoming e-mail.

Furthermore, setting IncomingMaildir parameter clarifies that incoming email handling is setup. This is useful for other packages to determine if they can rely on incoming e-mail working (e.g. to set the reply-to email to an e-mail address which actually works through a callback if the IncomingMaildir parameter is enabled).