Qmail turns addresses in a virtual domain into subaddresses of a local user, then handles the subaddressed message like any other local message. The translation from virtual to local addresses is in the control file virtualdomains. Assume, for example, that it contained the line: myvirt.com:virtuser Then mail addressed to marvin@myvirt.com is translated to virtuser-marvin, and then delivered normally. If there's a user virtuser, it checks for ~virtuser/.qmail-marvin or ~virtuser/.qmail-default. If there's no such user (which is often the case), the address is turned into alias-virtuser-marvin and delivered under the control of ~alias/.qmail-virtuser-marvin or ~alias/.qmail-virtuser-default or ~alias/.qmail-default. When qmail translates the mailbox part of a virtual domain address, it does not change the domain. That is, in the previous example, marvin@myvirt.com is translated to virtuser-marvin@myvirt.com. This seems like a mistake, because this is not Marvin's address, until you realize that the translated address is used only within qmail. The virtual domain remains with the address throughout the delivery process, so delivery programs can check $HOST or $RECIPIENT to tell whether a message was addressed to a virtual domain or to the (nearly) equivalent local address. Later in this chapter, fastforward makes good use of this ability.
|