smtproutes

/var/qmail/control/smtproutes lets you redirect mail through other servers.

Want to have a Qmail server relay all mail for a particular domain to another mailserver? Edit/Create /var/qmail/control/smtproutes with something along the lines of:
Relay all mail through mailhop.dyndns.org:

:mailhop.dyndns.org

Relay mail for example.com through 192.168.0.5:

example.com:[192.168.0.5]

Relay mail for example2.com through mail.mydomain.com

example2.com:mail.mydomain.com

The specific you entry you use will vary depending on whether you want to relay to a particular IP address, hostname, etc.
NOTE: Make sure that /var/qmail/control/virtualdomains doesn't have an entry for that domain.
Why would you want to relay mail to another server? You could be setting up an offsite backup MX server that hold the mail until your regular server goes down. Or you might have amail hub sort of arrangement where you have multiple servers processing incoming mail and forwarding them to a central mailbox server.

Credits

Various bits of code, scripts, and procedures were put together with information from John Simpson's qmail.jms1.net website. It's an excellent resource on managing and setting up a Qmail server.

Recent Updates

  • 1 year 12 months ago
  • 1 year 12 months ago
  • 1 year 12 months ago
    php 8.x
  • 2 years 1 hour ago
    10.6.7
  • 2 years 1 day ago
    Drop Centos 5/6 stuff