Don't Miss

Forwarding Email to another host via Qmail

By on January 25, 2013

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.

After googling and searching, I found a site teaches “forwarding Email to another host” using Qmail. I tried, as the article recommends setting up a Qmail config file (which didn’t existed):

/var/qmail/control/smtproutes

Containing a Qmail Email domain forwarding rule:

[domain.com]:[ip address]

So If you are running Plesk Parallel Panel, Qmail was being run with virtual domain support and spotted a Qmail config file:

/var/qmail/control/virtualdomains

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.

These are what you need to do, the process are:

#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!

#2. Set up your destination Email Server to receive Email for the relevant (sub)domain and Email account(s).

#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).

#4. A necessary to create the Qmail config file /var/qmail/control/smtproutes.
Add a forwarding rule to /var/qmail/control/smtproutes

[domain.com]:[ip address]

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.:

:[ip address]

#5. Now you can restart Qmail:

$ /etc/rc.d/init.d/qmail restart

#6. Check your destination Email Server which should now be receiving Email sent to Server A for the source domain.

This worked fine for me using (source server) Centos/Fedora/Plesk 8,10,11/Qmail and destination server smartermail/Postfix.

About jonboy60

Contact Me for computer repair services, mobile repair services, website repair services, website maintenance, creating website, domain name, hosting services, career opportunities, business offers, Linux solutions for business or home, web and email server solutions, Linux consulting, wordpress web consulting & development and expertise requests. Currently reside in Rawang, Selangor. Email to me on jonboy60{@}gmail.com

Leave a Reply

Your email address will not be published. Required fields are marked *