We only use domain instead of dom because dom already includes the handleMail directive that we want to demonstrate.
domain "yourdomain" with handleMail; (* HCoop should provide relaying for yourdomain *) emailAlias "user1" "user1@gmail.com"; (* Forward mail from user1@yourdomain to user1@gmail.com *) emailAlias "user2" "me"; (* Forward mail from user2@yourdomain to HCoop user me *) aliasMulti "pals" ["pal1@yahoo.com", "pal2@prodigy.com", "pal3"]; (* Forward mail from pals@yorudomain to pal1@yahoo.com, pal2@prodigy.com, and HCoop user pal3 *) aliasDrop "spamtrap"; (* Silently drop all mail to spamtrap@yourdomain *) defaultAlias "me"; (* Send all yourdomain mail, period, to user me *) addDefaultSPF; (* Only allow mail to be sent through your MX, typically mail.hcoop.net. *) end;
1. External Mailserver
Using an external mailserver is possible by adding manual DNS records.
dom "yourdomain" where AddMX = false; (* Removes default mail.hcoop.net DNS record. *) with dnsMail 10 "mail.externalmailserver.com"; dnsMail 50 "mail2.externalmailserver.com"; dnsDefaultText "v=spf1 include:_mailcust.externalmailserver.com ?all"; (* Sets TXT record for verification. *) end;