Mail Forwarding and Filtering on a Black Box

The Cyrus server is intended to run as a black box. Because users have no home directories on the Cyrus server, they cannot enable mail forwarding by creating a .forward file.

Forwarding

How is forwarding done without .forward files? You guessed it—user mail forwarding is from within the sendmail aliases database on a Cyrus system. To make maintenance easier, you can keep the user aliases and the system aliases in separate files:

  • System aliases should be kept in the standard /etc/mail/aliases file.

  • Users’ mail forwarding orders should be stored in another file (or files), defined in your local sendmail configuration.

Let’s suppose that we will store users’ forwarding orders in an alias file that’s named /etc/mail/forward. The format of the /etc/mail/forward file is the same as the sendmail aliases file format. To activate the /etc/mail/forward file, edit your M4 file (sendmail ships with an example, cyrusproto.mc, or you may have rolled your own) and add the following line:

define('ALIAS_FILE', '/etc/mail/aliases,/etc/mail/forward')

Finally, build a new sendmail.cf file and restart sendmail. If you don’t use an M4 macro to build your sendmail.cf file, then edit your sendmail.cf file and look for the lines:

# location of alias file
O AliasFile=/etc/mail/aliases

Change the definition of AliasFile to:

O AliasFile=/etc/mail/aliases,/etc/mail/forward

Because users cannot log in and directly edit their forwarding orders, they need to be allowed ...

Get Managing IMAP now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.