{"id":4832,"date":"2014-02-25T00:11:30","date_gmt":"2014-02-24T16:11:30","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=4832"},"modified":"2023-04-28T09:48:20","modified_gmt":"2023-04-28T09:48:20","slug":"how-to-setup-postfix-transport-to-route-the-email-messages","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-setup-postfix-transport-to-route-the-email-messages\/","title":{"rendered":"How to setup Postfix Transport to Route the email messages"},"content":{"rendered":"<p>This post will show you how to route messages to other mail server using postfix transport file. This feature allows you to perform mail routing to respective host according to the map defined. Postfix will checking the transport map first instead of reading the DNS for MX record. The steps was tested on CentOS 6.5 and Postfix 2.6.6.<\/p>\n<p>1. In order for Postfix to use the transport file, configure main.cf to use transport map :<\/p>\n<pre>\nvi \/etc\/postfix\/main.cf\n<\/pre>\n<p>Append the following at the bottom :<\/p>\n<pre>\ntransport_maps = hash:\/etc\/postfix\/transport\n<\/pre>\n<p>2. Edit transport map file :<\/p>\n<pre>\nvi \/etc\/postfix\/transport\n<\/pre>\n<p>Append the following at the bottom :<\/p>\n<pre>\nehowstuff.local           smtp:[192.168.0.2]\n<\/pre>\n<p>3. Rebuild the transport database file :<\/p>\n<pre>[root@mx-mx06 ~]# postmap \/etc\/postfix\/transport<\/pre>\n<p>Note : The command &#8220;postmap \/etc\/postfix\/transport&#8221; should be execute whenever you change the transport table.<\/p>\n<p>4. Reload postfix to apply the new transport :<\/p>\n<pre>\n[root@mx-mx06 ~]# postfix reload\npostfix\/postfix-script: refreshing the Postfix mail system\n<\/pre>\n<p>5. Verify :<\/p>\n<pre>\n[root@mx-mx06 ~]# telnet localhost 25\nTrying ::1...\nConnected to localhost.\nEscape character is '^]'.\n220 mx.ehowstuff.local ESMTP Postfix\nehlo abc.com\n250-mx.ehowstuff.local\n250-PIPELINING\n250-SIZE 10240000\n250-VRFY\n250-ETRN\n250-ENHANCEDSTATUSCODES\n250-8BITMIME\n250 DSN\nmail from:root@ehowstuff.local\n250 2.1.0 Ok\nrcpt to:root@ehowstuff.local\n250 2.1.5 Ok\ndata\n354 End data with <cr><lf>.<cr><lf>\n.\n250 2.0.0 Ok: queued as D02D861B50\nquit\n221 2.0.0 Bye\nConnection closed by foreign host.\n<\/lf><\/cr><\/lf><\/cr><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This post will show you how to route messages to other mail server using postfix transport file. This feature allows you to perform mail routing to respective host according to&#8230;<\/p>\n","protected":false},"author":6,"featured_media":3321,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1028],"tags":[1256,1664],"class_list":["post-4832","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postfix","tag-centos-6-5","tag-postfix"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=4832"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4832\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/3321"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=4832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=4832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=4832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}