Secondary Domain email account - Webmail login

What is the proper way of logging into webmail using a email address that is attached to a Secondary Domain name?

If I have two domains:
domain1.com [Master domain]
domain2.com [Secondary Domain]

I set up a few email address’s in the secondary domain, domain2.com, and when the person with the email address goes to domain2.com/webmail and when trying to login is ejected back to the login screen, (yes login info is correct).

Now when they go to domain1.com/webmail and try to login with their email address assigned in the domain2.com secondary account, this person can login without issue.

So, is there a problem with the login for domain2.com/webmail?
Or
Is everything working the way it should and all secondary domains must use the master domain, in this example, domain1.com to login to webmail?