To cleanly handle double bounces:
1. Create a dot-qmail file at /var/qmail/mailnames/yourdomain.com/.qmail-doublebounce containing:
|exit 0
2. Route double bounces to this file:
echo yourdomain.com > /var/qmail/control/doublebouncehost
echo doublebounce > /var/qmail/control/doublebounceto
To whitelist a host on a qmail install (qmailrocks in this case) do the following:
Edit /etc/tcp.smtp and add this line:
XXX.XXX.XXX.:allow,RBLSMTPD=""
Replacing XXX.XXX.XXX. with the ip of the host to be whitelisted.
Next rebuild the cdb file with:
qmailctl cdb
This first procedure prevents RBL checks on the host.
To whitelist a host or domain in spam assassin, edit vi /etc/mail/spamassassin/local.cf and add a line like this:
whitelist_from *@friendlydomain.net
With a web browser go to http://lazyinstaller.net/pages/generator.xhtml and complete the form.
Copy/paste the generated script to a text file on the target server and make executable.
Edit the script and comment out the first echo line.
Run the script.
Here's a link to a qmail faq:
http://cr.yp.to/qmail/faq.html
Don't know if it's the most recent version.
In qmail, relaying is usually controlled by the tcpserver wrapper which uses a config file at either /etc/tcp.smtp or /home/vpopmail/etc/tcp.smtp.
The config file must be compiled into a binary format - "tcp.smtp.cdb" for actual use. Here's the command line:
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
You don't need to restart qmail after rebuilding the database.