Server won't route to remote exchanger
I'm trying to send mail through Outlook365 but I don't seem to be able to connect to external servers?
(I really want to point out that our server setup is... idiosyncratic. It's likely that the server has been set up strangely long before I joined the company.)
As a test I've created a subdomain, let's say email-test.account-domain.com, and set its MX entry through
to Remote Mail Exchanger. The index.php found at email-test.account-domain.com tries to send an email through phpmailer using the following settings: [CODE=php]$mail->SMTPDebug = 4; $mail->isSMTP(); $mail->Host = 'smtp.office365.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true;
Now, my understanding is that this, combined with the 'remote email exchanger' setting will cause phpmailer to attempt to to connect to 'smtp.office365.com'. Instead what I get is this:
...so hosting-domain.com is the root domain for WHM (that's my understanding I'm no expert at this). I recognise des.hosting-domain.com as the place I receive notifications from the server from (regardless of which account or domain generated the message which, now I think about it, is a little weird to me). So it's clear that the server is misconfigured. Does anyone have any thought as to how it's misconfigured or, better yet, any solutions?
DNS Functions > Edit MX Entryto Remote Mail Exchanger. The index.php found at email-test.account-domain.com tries to send an email through phpmailer using the following settings: [CODE=php]$mail->SMTPDebug = 4; $mail->isSMTP(); $mail->Host = 'smtp.office365.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true;
Now, my understanding is that this, combined with the 'remote email exchanger' setting will cause phpmailer to attempt to to connect to 'smtp.office365.com'. Instead what I get is this:
2019-10-22 04:45:52 Connection: opening to smtp.office365.com:587, timeout=300, options=array()
2019-10-22 04:45:52 Connection: opened
2019-10-22 04:45:52 SMTP INBOUND: "220-des.hosting-domain.com ESMTP Exim 4.92 #2 Tue, 22 Oct 2019 15:45:52 +1100"
2019-10-22 04:45:52 SMTP INBOUND: "220-We do not authorize the use of this system to transport unsolicited,"
2019-10-22 04:45:52 SMTP INBOUND: "220 and/or bulk e-mail."
2019-10-22 04:45:52 SERVER -> CLIENT: 220-des.hosting-domain.com ESMTP Exim 4.92 #2 Tue, 22 Oct 2019 15:45:52 +1100 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2019-10-22 04:45:52 CLIENT -> SERVER: EHLO email-test.account-domain.com
2019-10-22 04:45:52 SMTP INBOUND: "250-des.hosting-domain.com Hello email-test.account-domain.com [*snip*]"
2019-10-22 04:45:52 SMTP INBOUND: "250-SIZE 52428800"
2019-10-22 04:45:52 SMTP INBOUND: "250-8BITMIME"
2019-10-22 04:45:52 SMTP INBOUND: "250-PIPELINING"
2019-10-22 04:45:52 SMTP INBOUND: "250-AUTH PLAIN LOGIN"
2019-10-22 04:45:52 SMTP INBOUND: "250-STARTTLS"
2019-10-22 04:45:52 SMTP INBOUND: "250 HELP"
2019-10-22 04:45:52 SERVER -> CLIENT: 250-des.hosting-domain.com Hello email-test.account-domain.com [*snip*]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
2019-10-22 04:45:52 CLIENT -> SERVER: STARTTLS
2019-10-22 04:45:52 SMTP INBOUND: "220 TLS go ahead"
2019-10-22 04:45:52 SERVER -> CLIENT: 220 TLS go ahead
2019-10-22 04:45:52 Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=`des.hosting-domain.com' did not match expected CN=`smtp.office365.com' [*snip*/phpmailer/phpmailer/src/SMTP.php line 405]
SMTP Error: Could not connect to SMTP host.
2019-10-22 04:45:52 CLIENT -> SERVER: QUIT...so hosting-domain.com is the root domain for WHM (that's my understanding I'm no expert at this). I recognise des.hosting-domain.com as the place I receive notifications from the server from (regardless of which account or domain generated the message which, now I think about it, is a little weird to me). So it's clear that the server is misconfigured. Does anyone have any thought as to how it's misconfigured or, better yet, any solutions?
-
Hi @Foodstuff Thanks for the detailed explanation of the issue, it's really helpful! Do you happen to have SMTP restrictions enabled in WHM? You can check at WHM>>Security Center>>SMTP Restrictions. If you do, does the issue persist if it is disabled? 0 -
...of course it was going to be something so trivial. Thanks. 0
Please sign in to leave a comment.
Comments
2 comments