Setting up SMTP relays with EXIM and Office 365

Spork Schivago

Well-Known Member
Jan 21, 2016
597
64
28
corning, ny
cPanel Access Level
Root Administrator
Hi!

I've been reading some good articles here on setting up an SMTP relay, but I can't really find what I'm looking for.

We use IMAP folders, not sure if that matters.

But I have three domains.

I want, when we send email to the two of them, it'll check if the email address exists on Exchange 365 server first, if not, forward it to my two domains, check if it exists there, if not, bounce it back to Exchange so it can send a message that the account doesn't exist.

Is this possible to do?

I thought I had found an article describing this exact scenario on the net a while back, but I was unable to dig it back up. Should have bookmarked it.

Thanks!
 

24x7server

Well-Known Member
Apr 17, 2013
1,911
96
78
India
cPanel Access Level
Root Administrator
Twitter
Hi,
Is this possible to do?
I don't think this will be possible. However, you can setup multiple MX records with different priority to check if it works the way you want..
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
  • Like
Reactions: Spork Schivago

Spork Schivago

Well-Known Member
Jan 21, 2016
597
64
28
corning, ny
cPanel Access Level
Root Administrator
That first link looks like the one I want. If I'm reading it right, I do part 1 and then part 2, so mail will go from Exchange (Office 365 Enterprise E3) to cPanel, then with the second part configured properly, it'll bounce back if the address isn't found.

Seems about right! I figured this wasn't supported, so I do appreciate you taking the time to point me in the right direction. Currently, people are having trouble sending me mail. It bounces, but I have it setup like @24x7server suggested, with the two MX records and different priorities.

There's multiple problems with this approach though. Microsoft scans the MX record and if it's not just right, it'll fail, so their record has to have priority 0 (highest). And without the connectors, if it don't find the username in the Exchange server, it'll bounce. Mailclients don't seem to like to have two accounts setup with the same domain name, atleast Outlook doesn't.
 
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello @Spork Schivago,

Feel free to update this thread with the outcome if you decide to try using the solution referenced in the first link.

Thank you.