The remote host now sends one or more RCPT TO commands, which specify the recipients of the message:
Just a minute! elsewhere.com is not one of the domains that your server hosts. What does your server do? It can agree to accept the message and attempt to deliver it:
Or it can reject it:
553 sorry, that domain isn’t in my list of allowed rcpthosts (#5.7.1)
In the first case, your server is acting as a relay: it’s accepting and agreeing to try to deliver a message that’s not destined for a domain that your server hosts. In the second case, it’s refusing to act as a relay.
qmail’s rcpthosts file, which gets its name from the RCPT TO command, determines whether the recipient will be accepted: it will be accepted if and only if the domain of the address given in the RCPT TO command is listed in rcpthosts. (I’ll talk about exceptions to this rule later on.) If the rcpthosts file does not exist, then any recipient will be accepted.
An SMTP server is an “open relay” if it agrees to relay mail no matter who’s sending it–if another host connects to port 25 with some mail, an open relay will accept and try to deliver it no matter what its destination is and no matter who is sending it. A qmail server without a rcpthosts file will act as an open relay.