We occasionally have customer-provided servers in our technical support and engineering departments. They're isolated on their own VLAN, with strict firewall rules in place to minimize possible bad behavior.
We've found ourselves needing to capture (instead of block) outgoing mail by these machines. Redirecting ports and feeding machines fake MX records is easy. Creating a fake open relay doesn't seem to be. My goal is:
- Mail to firstname.lastname@example.org gets relayed upstream (
relay_domain = $mydomainand
relayhost = $mydomain)
- Mail to email@example.com gets captured and forwarded to an email address @ourdomain.com
Things that probably won't work, as answered in other similar questions:
- BCC maps: I don't want the original mail delivered to the original recipients at all.
- virtual_alias_maps: The outgoing mails could be to any domain, not just one or two domains.
- canonical rewriting
/^.*$/: Modifies all mail, which isn't what I want. I only want non-relayable mail to be forwarded.
If this isn't possible in postfix, can other MTAs handle the task? It looks like my other obvious choices are sendmail and exim.