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?
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
To relay email for a specific
domain.com to another mail server, create the line:
To relay all email to another mail server, regardless of the destination domain, create this line:
Here's a working configuration example where all mail to
domain2.com is relayed via
relay2-mail-server.com and all other domains mail is relayed via
# 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 #