Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 gets relayed upstream (relay_domain = $mydomain and relayhost = $mydomain)
  • Mail to gets captured and forwarded to an email address

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.

share|improve this question
It is not difficult do implement that. But why would you? This violates some RFCs. This is nothing I'm going to help you out. Better block mails not intended to be relayed. – mailq Oct 7 '12 at 13:37
This is inside of a lab / technical support environment. We're trying to prevent mails from (possibly malicious) systems from reaching the internet, while still being able to inspect the content of those mails and know that they're trying to be sent. Meanwhile, we still need the ability to send "real" mail from those machines to ourselves at our normal addresses. – Charles Oct 7 '12 at 15:32

Set up smtp-sink -- it is included in Postfix source distribution, but may not be present in binary package.

share|improve this answer
Interesting. I could tie the message logging in with a quick script that watches the directory and re-mails selectively... – Charles Feb 17 '13 at 4:51

Use spamhole:

From the website: spamhole is a fake sopen SMTP relay, intended to stop (some) spam by convincing spammers that it is delivering spam messages for them, when in fact it is not.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.