Let's look under the hood at what dom is doing by writing an equivalent configuration file that doesn't use it.
domain "$DOMAIN" with nameserver "ns1.hcoop.net"; nameserver "ns2.hcoop.net"; handleMail; defaultAlias "$USER"; web "www" with serverAliasDefault end; end;
Now we see what that with..end syntax was about: it relates to nested configuration directives. Both dom and the more primitive domain directive take additional configuration specific to the named domain. Everything we include here inside domain could also have been included inside a dom use, though it would be redundant.
The contents of the domain block are a series of DomTool language expressions that evaluate to actions. Each action is given using consistent programming language syntax, rather than the ad-hoc configuration syntaxes used by daemons like Apache and Exim. This means that the directives are sometimes slightly more verbose, but they are much easier for humans and machines to parse, since no directive-specific ad-hoc syntax information is required.
Let's step through the nested directives one by one to explain their meanings.
The nameserver lines register DNS mappings to be included in $DOMAIN's zone. In particular, we list the authoritative nameservers in order.
handleMail asks Exim to provide relaying for any e-mail message addressed to any address at $DOMAIN.
defaultAlias "$USER" directs Exim to deposit any mail addressed to any user at $DOMAIN in $USER's mailbox.
The www directive demonstrates several layers of nested configuration. It declares an Apache virtual host named www.$DOMAIN. web also adds the appropriate DNS mapping for this host. The nested directive serverAliasDefault asks to have this web host also answer to the name $DOMAIN, with no www in front.