I'm maintaining an IMAP server running FreeBSD which uses exim 4.80 as its MTA. Right now I try to create an email alias so that I can address all users of the system for informing them about scheduled downtimes and the like. The idea is that a mail to [email protected]
should get forwarded to all users on the system.
I initially considered having a simple simple /etc/aliases
entry but noticed that it's not what I want since users of the system may have Sieve filters in place which drop all incoming mails except a few whitelisted ones.
I did notice that exim can be made to deliver to a local Maildir directory straight away (by-passing any other MDA and thus bypassing Sieve filters) using the appendfile transport - but how can I make a single incoming mail to vmailusers
get redirected to multiple local maildirs?
You can use the redirect router to process alias messages. This is also the one which runs scripts / forward files given by the users. The processing of the routers happens from top to bottom, so the example below works roughly like this:
syswide_alias
router checks aliases in the/etc/aliases
file. If one is found, the routing sequence restarts.original_local_part
variable which is empty if no forwarding were done. If the lookup is successful, the message is delivered. In this case the processing stops (since a delivery was done), so any filters or forwards the user might have are ignored.forced_delivery
router declines, the.forward
file will be processed. If this file contains aliases, the routing sequence restarts.The
routers
section should look like this:Both the
syswide_alias
and theforced_delivery
routers have theallow_defer
option, which is needed if the file is not found (which is probably won't be the case, but it doesn't hurt anyway)Edit: The above example now contains a full set of routers needed to achieve the goals of the question.