1

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

Rob Forrest
  • 187
  • 4
  • 16

1 Answers1

1

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.

Alex
  • 7,789
  • 4
  • 36
  • 51