Is it possible to create email addresses like these:

  • user1@john.mydomain.com
  • user1@mary.mydomain.com
  • user1@smith.mydomain.com

and have them all handled by one mail server, as three different mail boxes?

(Many examples I've seen talk about directing mail to user2@jones.mydomain.com into the same mail box as user2@mydomain.com - but this is not what I'm looking for.)

I haven't specified the server technology being used because I'm wondering if this is generally possible. If you know that server x can do this, please mention it in your answer!

Is it correct that MX records can be set to direct email to all subdomains *.mydomain.com to one mail server? Is that still true if there are also web sites at those subdomains (using A records)?



Sendmail can do this with the virtusertable feature. You'd create a virtusertable like so:

james@domain1.com        X
james@domain2.com        Y
james@domain3.com        Z

I've opened the sendmail can of worms but I don't want to eat them. If you don't already know how to configure sendmail then you shouldn't attempt this.

As for the DNS question once you have any type of record for A.X.com then no wildcard will be consulted for any other type of record for A.X.com. Thus having an A record for a domain will prevent wildcard records from being used for the MX. This is documented in RFC 1034 section 4.3.3.

  • Thanks embobo... what does this mean? I don't have to use a wildcard record if I don't need to. Would I still need to create MX records for A.X.com? Jan 9 '11 at 17:10
  • It means your wildcard MX for *.mydomain.com won't be applied to john.mydomain.com if you create an A record for it. You would need to create an MX for john.mydomain.com. Jan 10 '11 at 18:06

Yup this can be done with AWS.

  1. In WorkMail, click Domains->Add Domain, and enter your full domain: john.mydomain.com
  2. That'll take you to a page in WorkMail, showing DNS records you need to add to your subdomain.
  3. Now, in Route 53->Hosted Zones, click on your domain.
  4. For each of the DNS records from step 3, add DNS records using the Create Record Set button
  5. Back in WorkMail->Users, click Add User to create the inbox for them.

That's it. As with anything in the AWS console, the steps can be automated (you could create a Lambda that just takes an input of someusername@somesubdomain.mydomain.com)


I use Google Apps Gmail, and we have several domains linked to the same mailboxes. For instance:


All of these are aliases for my mailbox. Google Apps also makes this really easy to setup through their Apps for your Domain panel. If it works for domain1.com and domain2.com, I don't see why it wouldn't work for subdomains as well like a.domain1.com and b.domain1.com, but it may involve making changes to your MX records.

  • Glen explicitly stated that he wants them to go to three different mail boxes Jan 7 '11 at 18:35
  • Ah, I missed that.
    – jmort253
    Jan 8 '11 at 5:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.