Simple generator of relay recipient map for basic secondary MX
By Pierre Palatin on Wednesday, February 11 2009, 21:34 - Permalink
A common problem with a secondary MX server for simple mail domains is the back-scatter spam. The spammer sends a mail to the secondary MX of a domain, using a non-existant username. If the secondary MX is configured to accept everything for the domain (which is usually the case), it will accept the mail and then try to transmit it to the primary. The primary will see that the username doesn't exists and bounce the message back to the spoofed FROM, hence spamming it.
The solution for that is to have the secondary MX check the existence of the username. Since the purpose of the secondary is to receive mail when the primary is down, it cannot ask for it dynamically and so must have a kind of static copy. For small domains (typical unix box with username being the local users and a few aliases), there's no existing sharing protocol for this information.
Since I'm not modifying often my aliases, I've choosen to simply generate a file with all aliases, copy it to the secondary and make it used by the local postfix.
This dead simple script will generate a map file suitable for postfix from the local users extracted from /etc/passwd and from local aliases in /etc/aliases. You just need to give it the domain name as parameter (e.g., palats.com ) and it will generate the list. It will match your actual configuration only if local delivery is based on aliases and local unix users. You can check that by looking for the following line in the output of postconf :
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
Once you have this list, generated on the primary, you can copy it to the secondary, as example in /etc/postfix. To make postfix use it, you need to :
- Run
postmap /etc/postfix/relay_palats_comto generate the.dbfile corresponding to the map file. In this case, the file is namedrelay_palats_com. - Add your map file to
relay_recipient_maps(in postfixmain.cffile). As example:
relay_recipient_maps = hash:/etc/postfix/relay_palats_com
- Restart postfix to apply the changes.
- And probably test that it works as expected, by connecting to the secondary and sending mail.
Be careful, such a change can easily bounce some mails if mistaken. It's common, even for legitimate mails with working servers, to have mail flowing from a secondary MX.
Comments
Big brother final tonight!
http://www.coachoutletfactory.com coach outlet
http://www.coachoutletfactory.com coach handbags
http://www.coachoutletfactory.com coach outlet online
http://www.coachoutletfactory.com coach outlet store
http://www.coachoutletfactory.com coach bags on sale
http://www.coachoutletfactory.com coach bags outlet
http://www.coachoutletfactory.com coach factory outlet online
http://www.coachoutletfactory.com coach outlet store online
http://www.coachoutletfactory.com coach outlet online store
http://www.coachoutletfactory.com coach factory outlet sale
http://www.coachoutletfactory.com coach online outlet store
http://www.coachoutletfactory.com/c... coach sunglasses
http://www.coachoutletfactory.com/c... COACH HANDBAGS
http://www.coachoutletfactory.com/c... COACH WALLETS
http://www.coachoutletfactory.com/c... COACH ACCESSORIES
http://www.coachoutletfactory.com/c... COACH BOOTS
http://www.coachoutletfactory.com/c... COACH SHOES
http://www.coachoutletfactory.com/c... Coach-Handbags
http://www.coachoutletfactory.com/c... COACH JEWELRY
http://www.coachoutletfactory.com/c... COACH APPAREL
http://www.coachoutletfactory.com/c... COACH MEN
http://www.coachoutletfactory.com/c... Coach Shoulder Bags
http://www.coachoutletfactory.com/c... Coach Sling Bags
http://www.coachoutletfactory.com/c... Coach Luggage Bags
http://www.coachoutletfactory.com/c... Coach Patchwork Purse
http://www.coachoutletfactory.com/c... Coach Baby Bags
http://www.coachoutletfactory.com/c... Coach Tote Bags
http://www.coachoutletfactory.com/c... Coach Backpack Bags
http://www.coachoutletfactory.com/c... Coach Carly Bags
http://www.coachoutletfactory.com/c... Coach Claire Bags
http://www.coachoutletfactory.com/c... Coach Garnet Bags
http://www.coachoutletfactory.com/c... Coach Hampton Bags
http://www.coachoutletfactory.com/c... Coach HOBO Bags
http://www.coachoutletfactory.com/c... Coach Leather Handbags
http://www.coachoutletfactory.com/c... Coach Sabrina Bags
http://www.coachoutletfactory.com/c... Coach Spotlight Bags
http://www.coachoutletfactory.com/c... Coach Travel Bags
http://www.coachoutletfactory.com/c... Coach Tribeca Bags
http://www.coachoutletfactory.com/c... New Coach Handbags
http://www.coachoutletfactory.com/c... Coach Ergo Bags
http://www.coachoutletfactory.com/c... Coach Maggie Bags
http://www.gucci-outlet.us/gucci outlet
http://www.gucci-outlet.us/gucci bags
http://www.gucci-outlet.us/gucci outlet online
http://www.gucci-outlet.us/gucci bags outlet
http://www.mbtshoesaleonline.com mbt shoes
http://www.coachoutletmalls.com coach outlet
http://www.gucci-outlet.us/gucci-ha... Handbags
http://www.gucci-outlet.us/gucci-ha... Backpacks
http://www.gucci-outlet.us/gucci-ha... Belt Bags
http://www.gucci-outlet.us/gucci-ha... Briefcases
http://www.gucci-outlet.us/gucci-ha... Computer Cases
http://www.gucci-outlet.us/gucci-ha... Duffels
http://www.gucci-outlet.us/gucci-ha... Hobos
http://www.gucci-outlet.us/gucci-ha... Jolicoeur
http://www.gucci-outlet.us/gucci-ha... Messenger Bags
http://www.gucci-outlet.us/gucci-ha... Shoulder Bags
http://www.gucci-outlet.us/gucci-ha... Top Handles
http://www.gucci-outlet.us/gucci-ha... Totes
http://www.gucci-outlet.us/gucci-ha... Travel Business
http://www.gucci-outlet.us/gucci-le... Leather Wallets
http://www.gucci-outlet.us/gucci-su... Sunglasses
http://www.gucci-outlet.us/gucci-wa... Wallets
http://www.gucci-outlet.us/gucci-ha... Hats
http://www.gucci-outlet.us/gucci-be... belts
http://www.gucci-outlet.us/gucci-br... bracelets
http://www.gucci-outlet.us/gucci-ea... earrings
http://www.gucci-outlet.us/gucci-ne... necklaces
http://www.gucci-outlet.us/gucci-sh... shoes
http://www.gucci-outlet.us/gucci-ba... barrette