> Dominik Schulz: >> I'm currently planning to migrate an Exim mailserver to Postfix due to >> performance issues and security concerns. >> >> The Exim mailserver is configured to handle several virtual domains. If >> a >> recipient is not found in the virtual table, before rejecting this >> recipient, >> exim checks an MS Exchange mailserver via SMTP if the it would accept >> this >> recipient. If it does the mail is accepted and relayed to the Exchange >> server. >> If it does not the mail is rejected. > > Postfix uses a deterministic routing model, where mail for domain > X is routed via a fixed path. > > You can make per-user overrides with virtual_alias_maps or > transport_maps, and use reject_unverified_recipient to find out if > a recipient address accepts mail. But this gets messy and results > either in rejecting mail (user unknown) or accepting too much, > causing you to become a backscatter source. > > The following is the simplest example that uses virtual_alias_maps > to deflect unknown users to the MS Exchange mailserver, and that > uses reject_unverified_recipient to find out if those users exist. > Postfix 2.7 and later automatically cache the reject_unverified_recipient > result. > > /etc/postfix/main.cf: > virtual_alias_domains = a.example > virtual_alias_maps = hash:/etc/postfix/virtual_alias > smtpd_recipient_restrictions = > reject_unauth_destination reject_unverified_recipient > > /etc/postfix/virtual_alias: > user1@a.example user1@localhost > user2@a.example user2@localhost > @a.example @ms-exchange-mailserver > > It is also possible to marry this to virtual_mailbox_domains, > but you didn't say that you were using those. > > Wietse
You're right. I'm using virtual_mailbox_domains, virtual_mailbox_maps and virtual_alias_maps to retrieve the information about the domains and recipients from a MySQL database. I'm sorry for the long delay but I first wanted to look into the solutions suggested. I've tried Victors suggestion using check_recipient_access backend by a longish MySQL query and empty relay_recipient_maps, but I'm still unsure wheter this'd be the best solution. Best Regards, Dominik Schulz