#
# Postfix Admin
# by Mischa Peters <mischa at high5 dot net>
# Copyright (c) 2002 - 2005 High5!
# Licensed under GPL for more info check GPL-LICENSE.TXT
#

Please follow these steps if your mailserver is used as a backup MX for some
(or all) of your domains.

Note: The setup described in this file only checks the domain, not the full
mail address. 
You should use "reject_unverified_recipient" in your postfix config or setup
"relay_recipient_maps" with a list of valid mail adresses on the primary mx
to avoid that your backup MX accepts mails for non-existing recipient adresses.
Without this, your backup MX might become a backscatter source.

1. Modify main.cf
-----------------
In order for Postfix to use MySQL for relay_domains add the following
to your main.cf

relay_domains = proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf


2. mysql_relay_domains_maps.cf
------------------------------
You will need to put this into a text file for postfix to pickup.

user = postfix
password = password
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain = '%s' AND backupmx = '1'


3. Restart Postfix
-------------------
When you are done make sure to restart Postfix so the changes take effect.
