Forwarding Email to another host via Qmail

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.

jonboy60

I’m a Malaysian, my name is Jon Loh (jonboy60) living in Kuala Lumpur and working in Petaling Jaya, Malaysia. Jonboy60.com is a blog magazine about Linux and other open source softwares. All about to a daily jobs or real life experiences I had since the year 2002 administrating Linux and Windows server in a hosting company. Basically i will be offering Linux tips, howto, tricks, latest news and tutorial. Contact Me for Career opportunities, business offers, Linux solutions for business or home, web and email server solutions, Linux consulting and expertise requests. Email to me on jonboy60{@}gmail.com. The site I’m running is VenCouture.com – Malaysia Online Fashion Shopping Boutique, VenCouture. We sell fashion clothes, sexy lingeries, baby clothing and etc.

More PostsWebsite

Follow Me:
TwitterFacebook

Leave a Reply

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

Connect with Facebook

*


5 + = 9

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge