Topic: relay domains with local mailboxes
==== Required information ====
- iRedMail Pro version: 1.8.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: CentOS 6.5
- Related log if you're reporting an issue:
====
I've got (I think) quite a complex setup that I can't seem to get my head around. Let me try to describe the setup:
Our incoming mail server is the iRedMail box, it serves 23 domains at the moment. Most of these domains have "service" mailboxes, i.e. imap boxes that need to be accessed by applications, not by humans. Some of the "human" mailboxes are hosted on the iRedMail server as well, some on secondary mailservers (for example office365 or GoogleApps).
So for every incoming email iRedMail needs to check:
1) do I have a local mailbox for it, and if so, deliver locally, process any forward defined
2) do I have an email address defined with a relay, if so, relay the mail to the defined secondairy server
3) no local mailbox, do I have a domain relay defined? If so, relay to the defined secondairy server
4) out of options, bounce with "user not found"
Now, 1, 2 and 4 can be implemented out of the box, but I'm struggling with 3.
I can define a relay at domain level, but that implements the BackupMX feature. If I check "Relay without verifying local recipients" the relay works, but 1 and 2 no longer works, all defined local email addresses are ignored. If I uncheck "Relay without verifying local recipients", 1 and 2 work, but unknown local users for that domain are not relayed, but bounced.
So, how can I convince postfix to use the domain relay definition ONLY if no local address could be matched?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.