Possible Duplicate:
How can I set up Postfix so that all email sent on my dev box gets routed to the developer email group?
I have a staging web server, and I have previously prevented any and all mail being sent out from it (I don't want my clients getting test messages from it). I've now set up postfix, but I want to restrict it so that the server only ever sends emails to recipients at one domain name. I've tried:
relay_domains = domain.com
smtpd_recipient_restrictions = reject_unauth_domain
.. among other variations. I've just switched it to simply this to see if that made any difference:
smtpd_recipient_restrictions = reject
But it's still sending out mail. I think all I'm doing is changing the relay settings, and I need to be changing something else, but can't make head or tail of the documentation.
I'm running postfix reload after each change, and postfix restart. This is on Ubuntu server.
I have a cheesy idea: set the smart host valid to an invalid ip address. Then emails that are local to the box will get delivered, but everything else will queue up waiting for delivery to that non existent host. Then just delete those every few days.
Another idea would be to use the transports file to redirect email for your customer domains to a non existent server. Or to a test server that is setup to accept email for all/multiple domains (such as your customer's domains).
This is the same idea as Walter provided, but more of an example with which you should be able to figure out what to do:
Oh-- "aLocalUser" is of course a local user on your box that will receive all of the emails that aren't actually being delivered externally.
I asked this question a second time, and got a response that worked from rems. See How can I set up Postfix so that all email sent on my dev box gets routed to the developer email group?