12.1 How Virtual Domains Work

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.

Don't Forget the DNS

If you want the outside world to be able to send mail to your virtual domains, they all need MX records in the DNS. If your local tests all work fine, but people elsewhere can't send you mail, DNS misconfiguration is a likely problem. If people can send you mail but your server rejects it, you forgot to put the domains in rcpthosts or morercpthosts.




qmail
qmail
ISBN: 1565926285
EAN: 2147483647
Year: 2006
Pages: 152

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net