November 17, 2019 5:19 PM, "Implausibility" <open...@hottub.ca> wrote:
> I'm reading the man pages for makemap, and there are two types of database > maps described, as per > $subject. > > What are the functional / operational differences between Primary & Virtual > Domains? When when I > choose one over the other? Can I get examples of when I'd choose a table of > primary domains, and > when I'd choose a table of virtual domains? > > Which one should I choose if I want to send *and* receive mail from domains > that are not the same > as my mail server's name? (e.g... my business has many websites... > example.com, example.us, > example.io - and I'd like to send and receive mail for each of them > separately... say, to route the > eMail to the sales rep for a specific territory) > > Thanks. I'll try to summarise it as simple as possible: During the SMTP transaction, an e-mail address is provided for the recipient: u...@domain.org With a primary domain, OpenSMTPD assumes that domain.org == the local machine. It will look for a system account matching the user and if one is found, then mail is delivered. The aliases mechanism is optional, if an alias exists a transform happens, otherwise the username is looked up as is. With a virtual domain, OpenSMTPD assumes that domain.org == the content of the virtual table. The virtual mechanism is not optional, the recipient MUST exist in the table to be valid. If you use a primary domain, when you create a new system user you can mail them right away. If you use a virtual domain, you'll have to declare that user in the table.