{"id":1843,"date":"2013-01-30T12:52:00","date_gmt":"2013-01-30T04:52:00","guid":{"rendered":"http:\/\/rmohan.com\/?p=1843"},"modified":"2013-01-30T12:52:00","modified_gmt":"2013-01-30T04:52:00","slug":"forwarding-email-to-another-host-via-qmail","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=1843","title":{"rendered":"Forwarding Email to another host via Qmail"},"content":{"rendered":"<p>Today I needed to relay\/forward all Email from one Server (Server A) to another Server (Server B). Server A is running Qmail (on CentOS). Server B is running company smartermail.<\/p>\n<p>After googling and searching, I found a site teaches \u201cforwarding Email to another host\u201d using Qmail. I tried, as the article recommends setting up a Qmail config file (which didn\u2019t existed):<\/p>\n<p>\/var\/qmail\/control\/smtproutes<\/p>\n<p>Containing a Qmail Email domain forwarding rule:<\/p>\n<blockquote>\n<p>[domain.com]:[ip address]<\/p>\n<\/blockquote>\n<p>So If you are running Plesk Parallel Panel, Qmail was being run with virtual domain support and spotted a Qmail config file:<\/p>\n<p>\/var\/qmail\/control\/virtualdomains<\/p>\n<p>This config file contained the name of the domain I was trying to forward followed by a colon and a number, Must remove the line containing the domain name trying to forward, then restart the Qmail.<\/p>\n<p> These are what you need to do, the process are:<\/p>\n<p>#1. Back up all your current, working config files and if at all possible, do this using a test domain or sub-domain name so if you make mistakes you have a backup!<\/p>\n<p>#2. Set up your destination Email Server to receive Email for the relevant (sub)domain and Email account(s).<\/p>\n<p>#3. Ensure that the domain name you are trying to forward Email for is in the Qmail config file \/var\/qmail\/control\/rcpthosts (this ensures that Qmail will handle Email for the domain).<\/p>\n<p>#4. A necessary to create the Qmail config file \/var\/qmail\/control\/smtproutes.<br \/> Add a forwarding rule to \/var\/qmail\/control\/smtproutes<\/p>\n<blockquote>\n<p>[domain.com]:[ip address]<\/p>\n<\/blockquote>\n<p>If you want to forward all Email for all domains handled by your Qmail Server, you can use a wildcard config which means you omit the source domain name e.g.:<\/p>\n<blockquote>\n<p>:[ip address]<\/p>\n<\/blockquote>\n<p>#5. Now you can restart Qmail:<\/p>\n<p>$ \/etc\/rc.d\/init.d\/qmail restart<\/p>\n<p>#6. Check your destination Email Server which should now be receiving Email sent to Server A for the source domain.<\/p>\n<p>This worked fine for me using (source server) Centos\/Fedora\/Plesk 8,10,11\/Qmail and destination server smartermail\/Postfix.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I needed to relay\/forward all Email from one Server (Server A) to another Server (Server B). Server A is running Qmail (on CentOS). Server B is running company smartermail.<\/p>\n<p>After googling and searching, I found a site teaches \u201cforwarding Email to another host\u201d using Qmail. I tried, as the article recommends setting up a [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1843"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1843"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1843\/revisions"}],"predecessor-version":[{"id":1845,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1843\/revisions\/1845"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}