Page 1 of 1

Problem when sending email

Posted: Tue Feb 01, 2022 7:13 pm
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! :)

Re: Problem when sending email

Posted: Tue Feb 01, 2022 7:18 pm
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.

Re: Problem when sending email

Posted: Thu Feb 10, 2022 10:05 am
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! :)

Re: Problem when sending email

Posted: Fri Feb 11, 2022 12:41 pm
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.