SMTP Server with smtp.office365.com

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
kerstens
Posts: 8
Joined: Wed Sep 13, 2017 2:54 pm

SMTP Server with smtp.office365.com

Post by kerstens »

Script URL: https://support.cybertwice.com/admin/ad ... _email.php
Version of script: 3.3.4
Hosting company: transip
What terms did you try when SEARCHING for a solution: "SMTP error" and "HELO command failed"

Write your message below:

I try to test/connect my SMTP Server with smtp.office365.com as the provider. The solution has work with basic authication. I move now to Oath authenication, but both (basic and Oath) are not working at the moment. I think it is not related to the Hesk software, but maybe someone can point me to a solution.

error:

2022-09-20 10:45:36 SERVER -> CLIENT: 220 AM0PR01CA0101.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 20 Sep 2022 10:45:36 +0000
2022-09-20 10:45:36 CLIENT -> SERVER: EHLO 21c26fe620e3e94cbe50e514377f1e4cfb77b1dca9f0411d9003f342fb3720b3
2022-09-20 10:45:41 SERVER -> CLIENT: 501 5.5.4 Invalid domain name [AM0PR01CA0101.eurprd01.prod.exchangelabs.com]
2022-09-20 10:45:41 SMTP ERROR: EHLO command failed: 501 5.5.4 Invalid domain name [AM0PR01CA0101.eurprd01.prod.exchangelabs.com]
2022-09-20 10:45:41 CLIENT -> SERVER: HELO 21c26fe620e3e94cbe50e514377f1e4cfb77b1dca9f0411d9003f342fb3720b3
2022-09-20 10:45:46 SERVER -> CLIENT: 501 5.5.4 Invalid domain name [AM0PR01CA0101.eurprd01.prod.exchangelabs.com]
2022-09-20 10:45:46 SMTP ERROR: HELO command failed: 501 5.5.4 Invalid domain name [AM0PR01CA0101.eurprd01.prod.exchangelabs.com]


thank you in advance.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: SMTP Server with smtp.office365.com

Post by Klemen »

This is a SMTP-level error.

Your server reports "21c26fe620e3e94cbe50e514377f1e4cfb77b1dca9f0411d9003f342fb3720b3" as your domain name?

Where is the "21c26fe620e3e94cbe50e514377f1e4cfb77b1dca9f0411d9003f342fb3720b3" coming from?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
kerstens
Posts: 8
Joined: Wed Sep 13, 2017 2:54 pm

Re: SMTP Server with smtp.office365.com

Post by kerstens »

Thanks for the reply.

Can it be related to this forum link. https://answers.microsoft.com/en-us/out ... c9ccf58380

And then this reply in the forum.

As our device was sending the domain encapsulated in brackets, it was not formatted correctly according to RFC. The standard allows servers to accept HELO/EHLO commands that are formatted incorrectly, which is why tests with other smtp servers passed successfully. Yet, since outlook.com requires the correct identifier, once we removed the brackets from the domain it worked well.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: SMTP Server with smtp.office365.com

Post by Klemen »

No, it looks like your server name is set to 21c26fe620e3e94cbe50e514377f1e4cfb77b1dca9f0411d9003f342fb3720b3 instead of a domain name, so that seems to be a server configuration issue.

The SMTP communication is done by PHPMailer which is a widely-used library. It fetches the domain name from $_SERVER['SERVER_NAME'] or gethostname() or php_uname('n'), in that order. So one of these is not returning a valid domain name but the 21c26fe620e3e94cbe50e514377f1e4cfb77b1dca9f0411d9003f342fb3720b3 string instead.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
kerstens
Posts: 8
Joined: Wed Sep 13, 2017 2:54 pm

Re: SMTP Server with smtp.office365.com

Post by kerstens »

Unfortunately I cannot set the domain name with this Transip service. Is it possible to set this domain name in a Hesk via Webgui or by editing a php file? Thanks again for the quick response
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: SMTP Server with smtp.office365.com

Post by Klemen »

I'm afraid that's a server-side configuration, it is not something that can be set inside Hesk.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply