Problem when sending email

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
krolli
Posts: 8
Joined: Tue Feb 01, 2022 6:48 pm

Problem when sending email

Post by krolli »

Hi!

I am using HESK v3.2.5.

My problem is when HESK sends an e-mail(e.g. submiting/closing ticket) the header includes multiple from: addresses. The first is the correct one(set in settings) and the second is probably the emailID@domain.com and the last is charset=“UTP-8”.
This is how i see it when sending to my webmail.

The problem is email providers(gmail,yahoo, etc.) doesn’t allow getting emails with multiple from addresses and they are rejected.

Everything worked fine before.

3 important changes happend recently:
- I upgraded to v3.2.5
- I changed PHP to 8.0
- My whole website was moved by the hosting to a new server, but rechecking the email settings (DKIM, SPF, MX) it seems everything is fine. Sending emails directly from webmail client works perfectly.

I don’t really know what is the source of the problem. Could you help me please?

Thank you! :)
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Problem when sending email

Post by Klemen »

Hesk will only set a single "From" email - the one you have set in Admin > Settings > General under "From" email.

Anything other than that is added by your mail server and is not something that can be influenced from Hesk.

If you are using PHP mail to send emails (Admin > Settings > Email > Send emails using) you should try switching to SMTP and see if that helps.
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
krolli
Posts: 8
Joined: Tue Feb 01, 2022 6:48 pm

Re: Problem when sending email

Post by krolli »

Hi!

Yes, switching to SMTP solved the problem, but i wanted to find the source of the problem, and i did.

Unfortunately it is/was in HESK. When formatting the headers, after every header item, simply \n is used, instead of \r\n (as stated in php documentation: https://www.php.net/manual/en/function.mail.php), so the header isn't correctly processed by the mail server(s).

The interesting thing is that in the past the mail server handled it good, but probably the new cPanel got stricter mail server rules when dealing with headers, but it's just a guess.

So i recommend replacing \n to \r\n in inc/email_functions.inc.php, lines 336-341, in the futures updates.

Thank you! :)
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Problem when sending email

Post by Klemen »

I presume there is some server-specific setting causing this as it works normally on thousands of other Cpanel servers.

In any case - as of version 3.3.0 Hesk will be using PHPMailer to construct and send emails so this shouldn't be an issue.
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