I was going to write something here about this, but after seeing this document: http://www.palomine.net/qmail/relaying.html, there's no need to, as it describes relaying perfectly.
man qmail-smtpd
tcprules
tcpserver
Jeremy Kitchen - kitchen at scriptkitchen dot com - 2/12/2004