Problem setting up SMTP

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
matlair
Posts: 2
Joined: Wed Nov 29, 2023 11:53 am

Problem setting up SMTP

Post by matlair »

HESK version: 3.4.3
PHP version: 8.2.6 (MySQLi)
MySQL version: 10.5.21-MariaDB-0+deb11u1

I am having problems setting up a SMTP connection on our self-hosted HESK - everything is configured as it should (AFAIK), SMTP connection test returns a success, but no e-mails are sent. Creating a ticket generates the following debug message (server name, smtp server and IPs censored):

2023-11-29 11:57:21 SERVER -> CLIENT: 220 SMTP.ADDRESS Microsoft ESMTP MAIL Service, Version: 8.5.9600.16384 ready at Wed, 29 Nov 2023 12:57:21 +0100 <br>
2023-11-29 11:57:21 CLIENT -> SERVER: EHLO SERVER.NAME<br>
2023-11-29 11:57:21 SERVER -> CLIENT: 250-SMTP.ADDRESS Hello [XX.XX.XX.XX]250-TURN250-SIZE 30720000250-ETRN250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-8bitmime250-BINARYMIME250-CHUNKING250-VRFY250-TLS250-STARTTLS250 OK<br>
2023-11-29 11:57:21 CLIENT -> SERVER: STARTTLS<br>
2023-11-29 11:57:21 SERVER -> CLIENT: 220 2.0.0 SMTP server ready<br>
SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL: Success<br>
2023-11-29 11:57:21 CLIENT -> SERVER: QUIT<br>
2023-11-29 11:57:21 SERVER -> CLIENT: <br>
2023-11-29 11:57:21 SMTP ERROR: QUIT command failed: <br>
SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL: Success<br>

Our HESK is running through Apache2 on port 80, over HTTP (it is only intended for local network use). The virtual server which hosts HESK also hosts GLPI, and GLPI has no problems sending e-mails through the same SMTP server, which doesn't require any login credentials. In HESK's Email settings, Encryption is set to "None" and "Do not validate server certificates" is enabled.
Nonetheless, I suspect this is a certificate problem? Is there any way to completely disregard certification and send e-mails through SMTP, as it is working on our GLPI?

Thanks and have a great day!
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: Problem setting up SMTP

Post by Klemen »

If you have a local SMTP server without authentication, why don't you try setting it up for PHP mail()?

In your php.ini find and configure section under

Code: Select all

[mail function]
Then restart the server and set Hesk to "Send emails using: PHP mail()"

Any luck?
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
matlair
Posts: 2
Joined: Wed Nov 29, 2023 11:53 am

Re: Problem setting up SMTP

Post by matlair »

Hello Klemen, thank you for the quick reply.

I have tried PHP mail, and it works perfectly! I had problems with it yesterday (emails would arrive to external recipients (e.g. *@gmail.com, etc), but not ones within our M365 tenant), but it seems to be working now.

Thanks for the assist, have a great day!
arib67
Posts: 1
Joined: Mon Nov 27, 2023 10:39 am

Re: Problem setting up SMTP

Post by arib67 »

It seems that youur HESK SMTP setup is facing challenges with SSL/TLS. For this, you should change the Encryption setting to "None" in HESK Email preferences and confirm that "Do not validate server certificates" is activated.
Post Reply