[HOWTO] Configure SMTP routes in Qmail server

Created:

2016-11-16 12:59:11 UTC

Modified:

2017-04-24 11:01:49 UTC

4

Was this article helpful?


Have more questions?

Submit a request

[HOWTO] Configure SMTP routes in Qmail server

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 10.4 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 9.5.4 for Linux

Question

I would like to configure a Qmail server to relay all outgoing messages from a particular domain to another mail server. How do I do that?

Answer

Make sure the domain is listed in /var/qmail/control/rcpthosts . This configures Qmail to accept mail for the domain.

Create the SMTP routes for the domain to the new server in /var/qmail/control/smtproutes .

To relay email for a specific domain.com to another mail server, create the line:

domain.com:some-other-mail-server.com

To relay all email to another mail server, regardless of the destination domain, create this line:

:some-other-mail-server.com

Here's a working configuration example where all mail to domain1.com , domain2.com is relayed via relay-mail-server.com , domain3.com via relay2-mail-server.com and all other domains mail is relayed via relay3-mail-server.com :

# cat /var/qmail/control/smtproutes
domain1.com:relay-mail-server.com
domain2.com:relay-mail-server.com
domain3.com:relay2-mail-server.com
:relay3-mail-server.com

Restart xinetd:

/etc/init.d/xinetd restart

Have more questions? Submit a request
Please sign in to leave a comment.