{"id":20,"date":"2007-09-24T09:57:50","date_gmt":"2007-09-24T08:57:50","guid":{"rendered":"http:\/\/www.nooblet.org\/blog\/-\/other\/postfix-transport-maps-diverting-mail-traffic\/"},"modified":"2014-06-10T20:05:31","modified_gmt":"2014-06-10T20:05:31","slug":"postfix-transport-maps-diverting-mail-traffic","status":"publish","type":"post","link":"https:\/\/www.nooblet.org\/blog\/2007\/postfix-transport-maps-diverting-mail-traffic\/","title":{"rendered":"Postfix Transport Maps &#8211; Diverting Mail Traffic"},"content":{"rendered":"<p>If like me, you host your own mail server on your broadband then you may of come accross this problem. Some ISP&#8217;s refuse to accept mail from dynamic IP ranges, and so they should! E-mail aware worms and viruses are used all over the world to send us spam, and the majority of them are on consumer PC&#8217;s hosted on dynamic IP ranges.<\/p>\n<p>Now, if you don&#8217;t have a static IP, and you want to send mail to a Gmail address your mail will be rejected. Using postfix as your MTA, you can work around this.<\/p>\n<p>Most ISP&#8217;s offer an SMTP relay server, now you may not want to use this all the time, so transport maps can send only mail for gmail addresses to your smtp relay, and the rest can go direct.<\/p>\n<p>Find out what your ISP&#8217;s SMTP server address is, usually smtp.yourisp.com. Create a file named <code>transport<\/code> in \/etc\/postfix and add the following text,<\/p>\n<blockquote><p>gmail.com smtp:<strong>smtp.yourisp.com<\/strong>:25<br \/>\ngooglemail.com smtp:<strong>smtp.yourisp.com<\/strong>:25<\/p><\/blockquote>\n<p><em>Remember to swap &#8220;smtp.yourisp.com&#8221; for the address of your ISP&#8217;s smtp relay server.<\/em><\/p>\n<p>Now we need to compile this file using the postmap command,<\/p>\n<blockquote><p>postmap \/etc\/postfix\/transport<\/p><\/blockquote>\n<p>Edit \/etc\/postfix\/main.cf and add this line at the bottom,<\/p>\n<blockquote><p>transport_maps = hash:\/etc\/postfix\/transport<\/p><\/blockquote>\n<p>Restart postfix and you should find all mail addressed to @gmail.com or @googlemail.com will be redirected to your smtp relay.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If like me, you host your own mail server on your broadband then you may of come accross this problem. Some ISP&#8217;s refuse to accept mail from dynamic IP ranges, and so they should! E-mail aware worms and viruses are used all over the world to send us spam, and the majority of them are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":648,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":3,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":1060,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions\/1060"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/media\/648"}],"wp:attachment":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}