The qmail newbie’s guide to relaying
I’ve been reading the qmail mailing list for the past several years, and if there’s one FAQ that’s more FA than any other Q, it’s the one the answer to which is “read FAQ 5.4.” The question takes many different forms, but generally it runs as follows: “When someone tries to send mail through my server, he gets a message that says, ‘Sorry, that domain isn’t in my list of allowed rcpthosts’ and can’t send mail. What do I do?”
In the ensuing answers and followup questions, it becomes clear that there’s a fair amount of confusion on the subject of relaying mail and what the rcpthosts file has to do with it, and how tcpserver’s tcprules can affect it. So I’ve written the following, exceedingly wordy explanation of relaying and how to do it selectively, and of some of the pitfalls involved. It may seem a bit much for a pretty simple concept, but having read hundreds of qmail mailing list messages on the subject, I think I can identify most of the sources of confusion and have tried to anticipate any question someone might have on the subject.