Relay SMTP messages to Office 365 / Smart Host
I can assure you that I have investigated this topic for hours before posting here. So here is so far what I have found:
Set up connectors to route mail between Office 365 and your own email servers
The office365 to our VPS connector is setup properly and we get emails to our VPS (on our WHM/cPanel).
We are now trying to setup the smart host so all the emails are routed / relayed to microsoft office 365 and then is sent through them. We have also created the inbound connectors per Microsoft suggestion (above link)
We tried Exim Configuration Manager>>Smarthost support>>
and we used *.protection.outlook.com or *.office365.com
nothing worked and our emails are bounced when we try to send emails from our VPS (cPanel).
Is there anyone who has successfully setup a connector for Micorosoft 365 and split the emails between exchange and WHM?
-
Hello @infocenter, Can you let us know the specific bounce message that you receive? Also, can you check if Local Mail Exchanger is configured for the domain you are testing with in cPanel >> Email Routing? Also, while the setup is different to yours, you may find some of the discussion in the following thread helpful: Thank you. 0 -
Email routing is set to "Automatic - Local" the bounce email message is as follows. The discussion you suggested goes back to 2011! Office 365 has changed a lot since then. However we have followed what has been suggested on the discussion. As mentioned we don't have any issue receiving emails. But we have the problem of sending out emails when Smart Host option is set. _________________________________________________________ Return-Path: <> Delivered-To: test@mydomain.com Received: from myhostname.com by myhostname.com with LMTP id oHBLF2IzmFuMaQAAVoenzA for ; Tue, 11 Sep 2018 16:28:02 -0500 Return-path: <> Envelope-to: test@mydomain.com Delivery-date: Tue, 11 Sep 2018 16:28:02 -0500 Received: from mailnull by myhostname.com with local (Exim 4.91) id 1fzqCY-00071d-Ah for test@mydomain.com; Tue, 11 Sep 2018 16:28:02 -0500 X-Failed-Recipients: ValidGmailAddress@gmail.com Auto-Submitted: auto-replied From: Mail Delivery System To: test@mydomain.com Content-Type: multipart/report; report-type=delivery-status; boundary=1536701282-eximdsn-780460104 MIME-Version: 1.0 Subject: Mail delivery failed: returning message to sender Message-Id: Date: Tue, 11 Sep 2018 16:28:02 -0500 --1536701282-eximdsn-780460104 Content-type: text/plain; charset=us-ascii This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: ValidGmailAddress@gmail.com The mail server could not deliver mail to OLE_LINK13">ValidGmailAddress@gmail.com. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries. --1536701282-eximdsn-780460104 Content-type: message/delivery-status Reporting-MTA: dns; myhostname.com Action: failed Final-Recipient: rfc822;ValidGmailAddress@gmail.com Status: 5.0.0 --1536701282-eximdsn-780460104 Content-type: message/rfc822 Return-path: Received: from [::1] (port=58240 helo=myhostname.com) by myhostname.com with esmtpa (Exim 4.91) (envelope-from ) id 1fzqCY-00070Z-72 for ValidGmailAddress@gmail.com; Tue, 11 Sep 2018 16:28:02 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 11 Sep 2018 16:28:02 -0500 From: test@mydomain.com To: ValidGmailAddress@gmail.com Subject: Testing Emails Message-ID: <595aedc8a45f5d59bd782b302c4cdbd4@domain.tld> X-Sender: test@mydomain.com User-Agent: Roundcube Webmail/1.3.3 Test Message --1536701282-eximdsn-780460104--0 -
Hello @infocenter, Can you also let us know the output from /var/log/exim_mainlog when sending a message? EX: exigrep SUBJECT /var/log/exim_mainlog
Additionally, have you tested sending out email to other remote destinations aside from Gmail? Thank you.0 -
Here is the log. Also we tried other email addresses like those on Microsoft, Yahoo, and others and the email bounces immediately. Per Microsoft Smart Host should be set to smtp.office365.com [root@hostname without main domain ~]# exigrep OutgoingcPanelTest1 /var/log/exim_mainlog2018-09-12 21:09:22 1g0H4M-0008Mb-CE <= test@mydomain.com H=(Hostname) [::1]:48430 P=esmtpa A=dovecot_login:test@mydomain.com S=645 id=4cab8f9eb0787e243162b5b1fb8bd227@mydomain.com T="OutgoingcPanelTest1" for ValidGmailAddress@gmail.com 2018-09-12 21:09:22 1g0H4M-0008Mb-CE Sender identification U=mydomain D=mydomain.com S=test@mydomain.com2018-09-12 21:09:22 1g0H4M-0008Mb-CE SMTP connection outbound 1536804562 1g0H4M-0008Mb-CE mydomain.com ValidGmailAddress@gmail.com 2018-09-12 21:09:22 1g0H4M-0008Mb-CE ** ValidGmailAddress@gmail.com R=fail_remote_domains: The mail server could not deliver mail to ValidGmailAddress@gmail.com. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries. 2018-09-12 21:09:22 1g0H4M-0008Mb-CE Completed0 -
Hello @infocenter, Could you open a support ticket so we can take a closer look and see if there's anything obvious in your configuration that's causing this problem? You can post the ticket number here and we'll link this thread to the ticket. Thank you. 0 -
Our support request ID is 10298351 0 -
So the issue is resolved (almost-read the notes below). For those of you who might be interested this is how it got resolved (thanks cPanel Support :) ) Step 1) Email Routing is set to "Local" Step 2) Go to your Microsoft Office 365 Admin portal and setup your connectors ( See this: email1@mydomain1.com resides on VPS but email2@mydomain.com is on Microsoft Exchange. But because the email routing is set to Local (remember Step 2? It won't work if you don't set it to local) then VPS just tries to send the emails to local which means it only tries to send the email only to local so if that user doesn't exist on the VPS but on microsoft exchange you will receive a bounced email. We are working on a solution for that but at least this is a temporary solution for the above issue. 0 -
Hello @infocenter, Thanks for sharing! We'll look forward to seeing what you find regarding the per-email account configuration. Note that we have had some threads about that in the past, but I'm not sure it would help in your particular scenario. Here's the link if you're interested: Thank you. -1
Please sign in to leave a comment.
Comments
8 comments