Wednesday, May 11, 2016

Setting up the Postfix SMTP server to route all your email to an external SMTP Gateway

Standard
Suppose you want all your web servers to locally send all email (maybe from your contact forms, or whatever) to a real smtp gateway. If you're running postfix as your MTA, this is quite easy to achieve.
In your main.cf file (usually /etc/postfix/main.cf or /usr/local/etc/postfix/main.cf), specify your transport maps:

transport_maps = hash:/etc/postfix/transport


And in your transport file (usually /etc/postfix/transport or /usr/local/etc/postfix/transport), specify your gateways per domain.
This allows you to specify with regular expressions which emails go where. In this case, an asterisk specifies every domain (the transport file allows very complex setups, this is of course an extreme and trivial example):

* smtp:myotherhost.com

Then invoke postmap to regenerate the transports db, and reload postfix: 

postmap hash:/etc/postfix/transport
postfix reload

 source : http://marcelog.github.io/articles/configure_postfix_forward_all_email_smtp_gateway.html

Related Posts:

  • Creating Graph for Mikrotik Queue Tree using CactiIt’s a long title, isn’t it ? Okay, first thing first, You have to download all these files : cacti_host_template_mikrotik_queue.xml cacti_data_templ… Read More
  • Mari Belajar BGP Apakah BGP? Border Gateway Protocol atau yang sering disingkat BGP merupakan salah satu jenis routing protocol yang ada di dunia komunikasi data. Se… Read More
  • Cacti Buat MikrotikTernyata sudah lengkap tool untuk monitoring Mikrotik dengan cacti. Jadi sekarang udah bisa menggrap : System HDD CPU Memory Uptime General Active PP… Read More
  • /bin/rm: Argument list too long.Squid mati lagi gara-gara disk log full….. di hapus malah keluar error “/bin/rm: Argument list too long.” setelah googling katanya filenya terlalu bes… Read More
  • Export Graph ProblemLagi-lagi cacti bermasalah, fungsi export graphnya tidak jalan. Biasa… googlin, dan nemu url ini : http://forums.cacti.net/viewtopic.php?t=20612&h… Read More

0 comments:

Post a Comment