[exim] Deliver to multiple virtual mailboxes

Top Page
Delete this message
Reply to this message
Author: Andreas Haschka
Date:  
To: exim-users
Subject: [exim] Deliver to multiple virtual mailboxes
I currently have running Exim with a MySQL database backend handling
virtual domains. The whole system works like a charm and I would be
really happy if it weren't for one issue I can't seem to solve in a
"non-ugly" way:

To simplify the setup, I currently have local email addresses mapped to
inboxes. Right now, one email address is mapped to one mailbox. What I
want to accomplish is, I want to be able to map one email address to
multiple mailboxes. Consider the following scenario:

2 email addresses:
- user1@??? -> mailbox1
- user2@??? -> mailbox2

Now what I want is:
- bothusers@??? -> mailbox1, mailbox2
...without redirecting to the addresses user1@??? and
user2@???. (I also have a vacation router in my setup, and doing
it this way, would possibly expose that for one of those addresses)

The necessary router and transport configurations look like this:

vacation_director:
driver = accept
domains = ${lookup mysql {MYSQL_Q_VACATION}{$value}}
transport = vacation_autoreply
unseen

virtual_local_mailbox:
driver = accept
domains = ${lookup mysql {MYSQL_Q_LOCAL_ADDRESS}{$value}}
transport = virtual_local_md_delivery

virtual_local_md_delivery:
driver = appendfile
directory = ${lookup mysql {MYSQL_Q_VMAILDIR}{$value}}
maildir_format
user = mail
group = mail
mode = 0660
directory_mode = 0770

(I didn't post the queries themselves, by the config it should be
obvious what they return, and well, they do work just fine)
The problem here is, if the MYSQL_Q_VMAILDIR query returns more than one
row, those rows are not separated in the transport by the "directory"
directive, instead it is treated as one long messy directory name like
"/var/spool/mail/virtual/mailbox1\n/var/sppol/mail/virtual/mailbox2".

Now my question is: Is there an easy way to deliver to multiple
mailboxes in the transport itself? I.e. did I just not find the correct
separator yet or do I really have to reroute via the redirect driver and
use some quirks to fall through the vacation router? (Or maybe even use
a pipe or file redirect or something like that)

Regards,
Andreas Haschka