Setting up sackhosted virtual domains

Starting from scratch

Let's just take this from the beginning: a new domain with nothing set up whatsoever. Here's a checklist of everything that needs to happen to get a new domain's DNS, mail, IMAP, and web going:

Register the domain, wait a day

If the domain isn't already registered, you'll want to take care of that. See sackdns. Whether it's registered or not, you'll want to make sure its nameservers are set to:

sjc.nameserver.net # haybaler
phl.nameserver.net # baconhouse
sou.nameserver.net # joshua

You can optionally also add:

rdu.nameserver.net # pound.ifndef.com
bos.nameserver.net # bos.priori.net
iad.nameserver.net

But that's up to you. Wait a day, for the information to make its way into the root nameservers, and the other steps can be performed.

Set up DNS

First, we'll want to set up the master nameserver. Most of our zones are on haybaler at the moment, though we'd like to move them to baconhouse. Best practice is currently to set new domains up on bacon. You'll want to copy /etc/namedb/primary/empty.zone to /etc/namedb/primary/yourdomain.tld and edit it appropriately: add A, CNAME, MX, and NS records here. See other zone files for examples. The most common case would be to list haybaler as the primary (lowest-numbered) MX, baconhouse second, and joshua third. Please don't list any of the non-sack nameserver.net machines as backup MXes, they won't accept your mail. [Note: On baler, the zone files are located in /usr/local/dns/primary for legacy reasons.]

Next, go to /usr/local/SackConfig and edit phl.conf (or sjc.conf, or whatever machine you're on.) The format here should be obvious: add master/slave lines for each nameserver.net machine you indicated would be serving up DNS for your domain.

This information is imported into our dns configuration and propogated amongst the nameserver.net machines every half hour -- you don't need to do anything else for DNS, just wait a few minutes. Don't try any lookups in this period, since a negative response will be cached by your local nameserver for a while.

Configure basic mail delivery

Once DNS is working (try nslookup www.hostname.tld) you can move on to basic mail configuration. On haybaler,

These all should be pretty obvious as well. The one requirement in virtual is that postmaster and abuse for your domains go to the correct role accounts for wherever the mail is going. For locally-delivered mail, that is 'postmaster' and 'abuse', respectively. You can trap all mail to your domains otherwise with the following syntax:
@mydomain.tld myuserid

On the boxes you designated as backup MXes, you'll want to add your domain to relaydomains, but don't mess with anything else. On baconhouse, this is simply a statement in main.cf.

Set up IMAP virtual users

If you want to set up virtual IMAP mailboxes, do the following for each userid: