While trying to configure Kerio Connect accounts to work concurrently with external providers such as O365, Gmail, etc, the message sending and receiving is not working for both providers together.
The domain name configuration is the same for both providers, i.e. feelmorelaw.com. The MX records are pointing to external servers. User accounts have the same usernames in Kerio Connect and an external server.
The Kerio Connect DNS resolver won't be able to deliver emails with the same email address (email@example.com) to another mail server provider (O365) if that mailbox exists in Kerio Connect Administration. Kerio Connect looks up for local mailboxes first, then attempts to deliver email to the outside world. This is the default behavior of the Kerio Connect.
For example, if sending an email to domain kerio-connect.xyz, Kerio Connect performs DNS lookup, because it cannot recognize such domain locally.
If the message is sent to the local user, the Kerio Connect is not performing DNS lookup. The same can be observed while enabling DNS Resolver and Antivirus checking Debug logs.
The Mail logs report the instant email delivery when sending emails to the local user (vlad@ to andrei@)
[11/Jun/2020 08:39:06] Recv: Queue-ID: 5ee1edaa-0000000f, Service: Kerio Connect Client, From: <firstname.lastname@example.org>, To: <email@example.com>, Size: 784, Sender-Host: 0.0.0.0, User: firstname.lastname@example.org, SSL: yes, Subject: Test, Msg-Id: <email@example.com>
[11/Jun/2020 08:40:04] Recv: Queue-ID: 5ee1ede4-00000010, Service: Kerio Connect Client, From: <firstname.lastname@example.org>, To: <email@example.com>, Size: 837, Sender-Host: 0.0.0.0, User: firstname.lastname@example.org, SSL: yes, Subject: Test local, Msg-Id: <email@example.com>
[11/Jun/2020 08:40:05] Sent: Queue-ID: 5ee1ede4-00000010, Recipient: <firstname.lastname@example.org>, Result: delivered, Status: 2.0.0 , Remote-Host: 127.0.0.1, Msg-Id: <email@example.com>
[11/Jun/2020 08:41:17] Sent: Queue-ID: 5ee1edaa-0000000f, Recipient: <firstname.lastname@example.org>, Result: delayed, Status: 4.4.1 Cannot connect to host, Remote-Host: mail.kerio-connect.xyz, Msg-Id: <email@example.com