Wednesday, February 24, 2010

Redirect all outgoing email to a single account with postfix

Wednesday, February 24, 2010 Posted by Andre Broers , , 7 comments
copied from: http://www.rene.bz/2009/01/28/redirect-all-outgoing-email-single-account-postfix

.Lab environments can get fairly messy if not maintained and the gentle hand of a sysadmin is routinely applied. Security compliance is generally the last thing on a developers mind whilst hacking away at projects still in the development stage. Having lab databases filled with unobfuscated customer data which is never a good idea, is unfortunately common.

Im not condoning having real customer data in a lab environment, though it does happen and there is a real potential for a disaster to occur such as testing out your latest 'mass email 2.0' code on your lab database not realising that your lab data is actually a production data set. Oh yer, you also forgot to firewall outbound port 25/tcp aswell as well as having recursion available within your internal BIND9 view. Doh!@#

Heck, having your lab have any access to the intertubes is just a plain bad idea.. period.

Again, im not condoning this though you may want to catch all outgoing emails and redirect them to a single email account which can be viewed by fellow engineers and developers as a means of testing your features that can generate email.

Postfix can be setup to redirect all outgoing email to a single account. As long as your code hands email off to your MTA, this hack will do what you need. Your main.cf will need to look a bit like this.

relayhost = 223.1.2.1
bounce_queue_lifetime = 0
maximal_queue_lifetime = 0
always_bcc = rene@localhost

relayhost lets postfix know what is the next host to relay outgoing email through. For this hack, set relayhost to a bogus address. Setting this to a bogus IP address will force postfix to keep the email in its delivery queue without it actually reaching its next hop.

bounce_queue_lifetime defines the amount of time a bounce message is queued before it is considered undeliverable. Postfix will only attempt to deliver the bounce message once if bounce_queue_lifetime is set to 0.

maximal_queue_lifetime is the maximal time a message is queued before it is sent back as undeliverable. Again, 0 forces postfix to only attempt once.

Finally, always_bcc is the email account that will catch all mail. This account will also catch Non-Delivery Notifcation's which may become annoying though a little procmail fu will fix that.

7 comments:

  1. for beginners like me need a lot of reading and searching for information on various blogs. and articles that you share a very nice and inspires me .
    cara menggugurkan kandungan
    obat aborsi
    kalkulator kehamilan

    ReplyDelete
  2. Coach Outlet http://www.coachoutletfactory-stores.us.com

    Kate Spade Outlet http://www.katespadefactoryoutlet.in.net

    ED Hardy Outlet http://www.edhardypopsale.com

    Coach Outlet Store Online http://www.coachstoreonline.in.net

    Kate Spade Outlet http://www.katespadeoutletstore.in.net

    Cheap Jordans http://www.cheapjordansretro.us.com

    Coach Purses http://www.coachpurses.eu.com

    Coach Outlet http://www.coachoutlet2016.us.com

    Tory Burch Shoes http://www.toryburchoutlets.us.com

    Longchamp Outlet http://www.longchampoutlet.in.net

    Michael Kors Handbags http://www.innnov8.com

    Coach Outlet http://www.innnovate.com

    Red Bottom Shoes http://www.redbottomshoes.us.org

    Moncler Jackets http://www.monclerdownjackets.us.com

    Kate Spade Outlet http://www.katespadeoutletstore.us.com

    Moncler Outlet http://www.moncleroutletonline.in.net

    Coach Factory http://www.maganates.com

    Coach Factory Outlet http://www.coachfactorysoutlet.in.net

    Kate Spade Outlet http://www.katespadesoutlet.us.com

    Ray Ban Outlet http://www.raybanoutletstore.in.net

    Christian Louboutin Shoes http://www.christianlouboutinshoes2016.in.net

    North Face Outlet http://www.northfaceoutlets.us.org

    Coach Factory Outlet http://www.coachoutletstore.name

    Kate Spade Outlet http://www.katespadeoutletonline.name

    Coach Outlet http://www.coach-outlets.us.org

    Nike Roshe Run http://www.tanie-nikerosherun.pl

    Buty Nike Air Max http://www.airmaxsprzedazdla.pl

    Nike Air Max http://www.nikeairmax.us.org

    Red Bottom Shoes http://www.redbottomshoe.in.net

    Christian Louboutin Outlet http://www.christianlouboutinoutlet.us.org

    Balenciaga Outlet http://www.balenciaga-outlet.us.com

    Balenciaga Handbags http://www.balenciaga-handbags.us.com

    Kate Spade Outlet http://www.katespadefactoryoutlet.in.net

    Toms Shoes http://www.tomshoesoutlet.us.com

    Hermes Belt http://www.hermes-belts.us.com

    Prada Outlet http://www.pradafactoryoutlet.com

    Louis Vuitton Outlet http://www.louisvuittonsoutlet.us.com

    North Face Outlet Store http://www.northfaceoutletstore.in.net

    North Face Jackets http://www.north-face.in.net

    North Face http://www.north-faceoutlets.us.com

    Louis Vuitton Outlet http://www.louisvuitton-outlets.us.org

    Timberland Boots http://www.timberland-outlets.us.com

    Cheap Timberland Boots http://www.timberlandoutlet.us.com

    Tory Burch Outlet http://www.toryburch-outlets.us.com

    Ralph Lauren Outlet http://www.ralphlaurenstoreoutlet.us.com

    Gucci Shoes http://www.guccifactoryoutlet.name

    Gucci Outlet http://www.guccioutletinc.us.com

    North Face Jackets http://www.northfacefactoryoutlet.us.com

    Prada Outlet http://www.pradaoutlets.in.net

    Hollister Clothing http://www.hollister-clothing.us.com

    Ferragamo Shoes http://www.ferragamoshoes.us.org

    Tiffany Outlet http://www.tiffany-outlets.us.com

    Tiffany Outlet http://www.tiffanyco-outlet.us.com

    NFL Jerseys http://www.nfljerseys.name

    Toms Outlet http://www.outlettoms.us.com

    Cheap Jordans http://www.cheapjordans.eu.com

    North Face Outlet http://www.thenorthfaceoutlet.us.org

    Prada Handbags http://www.pradaoutlet.us.org

    Chan Luu http://www.chanluu.us.com

    Toms Outlet http://www.tomsoutletstores.us.com

    Kate Spade Outlet http://www.katespadeoutletofficial.us.com

    Beats By Dr Dre http://www.beatsbydrdre.us.org

    Coach Outlet http://www.coachstoreoutlet.us.org

    Christian Louboutin Shoes http://www.christianlouboutinshoe.eu.com

    Valentino Shoes http://www.valentinoshoes.eu.com

    Michael Kors Outlet http://www.michaelkorsoutlet.us.org

    Coach Factory Outlet http://www.coachfactoryoutlet.us.org

    Coach Outlet Online http://www.coachoutletonlinestore.us.org

    Coach Purses http://www.coachpurse.us.com

    ReplyDelete
  3. This is a very good article material and it is very useful for us all. thank you . cara menggugurkan kandungan

    ReplyDelete