Well, as you do not give us any clue on what you are trying to achive and only let us guess, my guess is that the server is actually doing what it is intended for, ie delivering to its local accounts the mails for its configured domains, while this is not what you seem to expect...
So where do you want to access and recieve your emails for mydomain.com ?
My bad. Ok, I have the system installed as server only. We have our company email hosted by an outside provider, rackspace. In the server manager settings I have :
E-mail settings
POP3 server access Disabled
IMAP server access Disabled
Webmail access Disabled
Change e-mail access settings
Virus scanning Enabled
Spam filtering Disabled
Executable content blocking Disabled
Change e-mail filtering settings
E-mail retrieval mode Standard (SMTP)
SMTP authentication Allow both SMTP and SSMTP
Change e-mail reception settings
E-mail to unknown users Reject
Address of internal mail server
Address of Internet provider's mail server smtp.emailsrvr.com
Change e-mail delivery settings
I also set-up smtp-auth-proxy to use port 587 to forward emails to my company email address and I have all server messages set to forward to my rackspace email address.
All of this works when the domain is set to xxxxxxx.local
If I change the server domain to xxxxxxx.com, ( and that is the only change I make ) then none of the above settings work. No server messages are ever forwarded to my email.
I am using the .local domain as I need to receive server messages. The reason I tried to use xxxxxxx.com is too avoid the certificate mistmatch errors when employees log into the nextcloud app that is installed.
As mentioned in an earlier post, the email also stops if I keep xxxxxxx.local and add xxxxxxx.com as a secondary domain. As a test, I removed all the hostnames and addresses for the secondary domain server-manager and it had no effect on email delivery.