On Mon, Mar 21, 2011 at 03:04:15PM +0000, Jan Johansson wrote:
> I've been playing around with this for a bit, but I cannot find a
> smooth'n'easy way to do it...
>
> Basically we have a server that is primarily a testing environment for a
> couple of web based applications.
> These applications send mail. (Big surprise)
> These applications have a config switch which definies "Live" or "test". If
> set to "test" it should not generate any confirmation mails to customers and
> such.
>
> Well, a small bug meant that it DID send out a few dozen mails to "live
> customers", which was not really ideal.
>
> So, now I wonder if it would be possible to set postfix up to handle mail to
> two specific domains in a "normal way" and if mails are sent to any other
> domains, they should be redirected to a specific address. (To let our devs
> know that "Hey, you broke something again".
>
main.cf:
relay_domains = example.com
relay_transport = relay:[mail.example.com]
default_transport = smtp:[127.0.0.1]:10035
smtpd_restriction_classes = redirect_all
retable = pcre:${config_directory}/
redirect_all = check_client_access ${retable}redirect_all.re
redirect_all.re:
/^/ REDIRECT [email protected]
master.cf
127.0.0.1:10035 inet n - n - - smtpd
-o smtpd_data_restrictions=redirect_all
--
Viktor.