Last modified November 16, 2007. 25975. Questions, comments? Email mark at rauros. Like this guide? Link to it!
I'm currently seeking anyone willing to translate this document into anything other than English. Is that person you? Anyone who translates this document will be paid with an endless supply of my thanks.
Author: Mark (mark at rauros dot net)
Special Thanks: Carlos (rockwithme.org)
Special Thanks: Mike (atomos13.com)
Lets say you have four domains: localemail.tld, computers.tld, websites.tld, and servers.tld. You want to let them handle their own mail, but you want a centralized location for all of their spam/virus services. No problem! qmail handles this easily.
In your /var/qmail/control directory:
me should contain your qmail gateway's hostname.
locals should contain a listing of all of the domains for which your server will locally be accepting mail. If you don't plan on handling local mail on the machine, your locals file should be empty. For example:
defaultdomain should contain your domain name.
rcpthosts should have a listing (one per line) of the domains you are accepting mail for. For example:
smtproutes should contain something like "domain.tld:ipaddress". This works with both internal or external IP addresses. So, for example, you could have the following:
Seeing as this is going to be a gateway that will endure double bounces from spammers, it would be very useful to take advantage of one of qmail's configuration files and set up doublebounce configuration in the /var/qmail/control directory:
doublebouncehost contains your domains.
doublebounceto contains "doublebounce".
The alias /var/qmail/alias/.qmail-doublebounce should contain just a hash (#), or "octothorpe," as the contents, which will send the mail to /dev/null.
Congratulations! You now have a qmail gateway which will accept incoming messages, scan/filter/strip the messages, and pristinely forward them on to an internal or external SMTP server.