To be clear, there is no problem with sending external mail in or out though Exchange which hands it off to SGW then MDaemon server mailbox.
Yes the user is listed on within the domain on MDaemon and SecurityGateway (SGW). It may be an order of operations thing to some extent. Both servers are listed in the Mail Delivery list and 'use domain mail servers' was selected by default. The Exchange server was listed first.
If we change the Mail Delivery to 'Deliver mail using specified mail server' and just select MDaemon Mail Server.. Test from Exchange server from the same domain to a user (on the same domain) on DMaemon we get a 550 5.7.1 Sender unknown. We tried adding the domain name to the Allow list using both *@domain.com and the 'specific domain' allow entering the FQDN of the exchange server. Once that was done we got an Authentication required message. The sending user on the Exchange machine does not have a user account on the MDaemon servers.
It looks like MDaemon just looks to itself since is thinks it has that domain to itself.
Wed 2025-01-15 11:58:49: Attempting TCP connection to [192.168.1.146 : 25]
Wed 2025-01-15 11:58:49: Socket connection established (192.168.204.72 : 54662 -> 192.168.1.146 : 25)
Wed 2025-01-15 11:58:49: Waiting for protocol initiation...
Wed 2025-01-15 11:58:49: <-- 220 mail3.dougallmedia.com ESMTP Wed, 15 Jan 2025 11:58:27 -0500
Wed 2025-01-15 11:58:49: --> EHLO dougallmedia.com
Wed 2025-01-15 11:58:49: <-- 250-mail3.dougallmedia.com Hello dougallmedia.com [192.168.204.72], pleased to meet you
Wed 2025-01-15 11:58:49: <-- 250-ETRN
Wed 2025-01-15 11:58:49: <-- 250-AUTH LOGIN PLAIN
Wed 2025-01-15 11:58:49: <-- 250-8BITMIME
Wed 2025-01-15 11:58:49: <-- 250-ENHANCEDSTATUSCODES
Wed 2025-01-15 11:58:49: <-- 250-PIPELINING
Wed 2025-01-15 11:58:49: <-- 250-CHUNKING
Wed 2025-01-15 11:58:49: <-- 250-STARTTLS
Wed 2025-01-15 11:58:49: <-- 250 SIZE
Wed 2025-01-15 11:58:49: --> STARTTLS
Wed 2025-01-15 11:58:49: <-- 220 2.7.0 Ready to start TLS
Wed 2025-01-15 11:58:49: SSL negotiation successful (TLS 1.2, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384)
Wed 2025-01-15 11:58:49: --> EHLO dougallmedia.com
Wed 2025-01-15 11:58:49: <-- 250-mail3.dougallmedia.com Hello dougallmedia.com [192.168.204.72], pleased to meet you
Wed 2025-01-15 11:58:49: <-- 250-ETRN
Wed 2025-01-15 11:58:49: <-- 250-AUTH LOGIN PLAIN
Wed 2025-01-15 11:58:49: <-- 250-8BITMIME
Wed 2025-01-15 11:58:49: <-- 250-ENHANCEDSTATUSCODES
Wed 2025-01-15 11:58:49: <-- 250-PIPELINING
Wed 2025-01-15 11:58:49: <-- 250-CHUNKING
Wed 2025-01-15 11:58:49: <-- 250-REQUIRETLS
Wed 2025-01-15 11:58:49: <-- 250 SIZE
Wed 2025-01-15 11:58:49: --> MAIL From:<User1@dougallmedia.com> SIZE=2778
Wed 2025-01-15 11:58:49: <-- 550 5.7.1 Sender unknown
Wed 2025-01-15 11:58:49: ----------
I have mailbox on both systems and sending from exchange to a mailbox user with only a mailbox on MDaemon I'm rejected with 530 5.7.0 Authentication required
Wed 2025-01-15 12:09:57: --> 250 Ok, message saved
Wed 2025-01-15 12:09:57: <-- QUIT
Wed 2025-01-15 12:09:57: --> 221 See ya in cyberspace
Wed 2025-01-15 12:09:57: SMTP session successful (Bytes in/out: 34119/398)
Wed 2025-01-15 12:09:57: ----------
Wed 2025-01-15 12:09:57: Attempting TCP connection to [192.168.1.146 : 25]
Wed 2025-01-15 12:09:57: Socket connection established (192.168.204.72 : 54965 -> 192.168.1.146 : 25)
Wed 2025-01-15 12:09:57: Waiting for protocol initiation...
Wed 2025-01-15 12:09:57: <-- 220 mail3.dougallmedia.com ESMTP Wed, 15 Jan 2025 12:09:35 -0500
Wed 2025-01-15 12:09:57: --> EHLO dougallmedia.com
Wed 2025-01-15 12:09:57: <-- 250-mail3.dougallmedia.com Hello dougallmedia.com [192.168.204.72], pleased to meet you
Wed 2025-01-15 12:09:57: <-- 250-ETRN
Wed 2025-01-15 12:09:57: <-- 250-AUTH LOGIN PLAIN
Wed 2025-01-15 12:09:57: <-- 250-8BITMIME
Wed 2025-01-15 12:09:57: <-- 250-ENHANCEDSTATUSCODES
Wed 2025-01-15 12:09:57: <-- 250-PIPELINING
Wed 2025-01-15 12:09:57: <-- 250-CHUNKING
Wed 2025-01-15 12:09:57: <-- 250-STARTTLS
Wed 2025-01-15 12:09:57: <-- 250 SIZE
Wed 2025-01-15 12:09:57: --> STARTTLS
Wed 2025-01-15 12:09:57: <-- 220 2.7.0 Ready to start TLS
Wed 2025-01-15 12:09:57: SSL negotiation successful (TLS 1.2, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384)
Wed 2025-01-15 12:09:57: --> EHLO dougallmedia.com
Wed 2025-01-15 12:09:57: <-- 250-mail3.dougallmedia.com Hello dougallmedia.com [192.168.204.72], pleased to meet you
Wed 2025-01-15 12:09:57: <-- 250-ETRN
Wed 2025-01-15 12:09:57: <-- 250-AUTH LOGIN PLAIN
Wed 2025-01-15 12:09:57: <-- 250-8BITMIME
Wed 2025-01-15 12:09:57: <-- 250-ENHANCEDSTATUSCODES
Wed 2025-01-15 12:09:57: <-- 250-PIPELINING
Wed 2025-01-15 12:09:57: <-- 250-CHUNKING
Wed 2025-01-15 12:09:57: <-- 250-REQUIRETLS
Wed 2025-01-15 12:09:57: <-- 250 SIZE
Wed 2025-01-15 12:09:57: --> MAIL From:<user1_withmailboxesonbothserver@dougallmedia.com> SIZE=34253
Wed 2025-01-15 12:09:57: <-- 250 2.1.0 Sender OK
Wed 2025-01-15 12:09:57: --> RCPT To:<user2_withmailboxonMDaemonOnly@dougallmedia.com>
Wed 2025-01-15 12:09:57: <-- 530 5.7.0 Authentication required
Wed 2025-01-15 12:09:57: ----------