Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was wondering if anyone knows of a way to ideally intercept (if not block) mailx from sending emails?

The situation is that we have a development server (CentOS) that hosts the current version of our website. The system as part of its processes sends out confirmation emails and the like which I'd like to ensure never see the light of day.

Ideally we'd like to be able to route these to a specific mailbox such that we could interrogate the emails being sent out.

If that's not possible simply blocking them would be a good starting point.

What is the most encompassing way to ensure this and are there any pitfalls to be wary of?

Thanks

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

If you use Postfix as an MTA (which I guess is a default in CentOS) this can be easily done with transport_maps, just add these lines to /etc/postfix/main.cf:

transport_maps = hash:/etc/postfix/transport
luser_relay = your.local.user@your.local.domain

and create /etc/postfix/transport with the following content:

localhost :
your.local.domain :
* local:your.local.user

You should execute postmap /etc/postfix/transport then to make a hash representation of your transport map and restart Postfix. The local user your.local.user will get all outgoing emails then.

share|improve this answer
    
That looks like a great solution, I'll give it ago and let you know how I get on. –  Rob Forrest Aug 21 '12 at 13:00
add comment

Your Answer

 
discard

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.