Page 1 of 1

Email Notifications - Office 365

Posted: Tue Sep 25, 2018 7:58 am
by Mazurizi
Script URL: Internally hosted
Version of script: 2.8.2
Hosting company: Internally hosted
URL of phpinfo.php: Internally hosted
URL of session_test.php: Internally hosted
What terms did you try when SEARCHING for a solution:

Write your message below:

We updated from an older version of hesk back in August to 2.8.2 and I've just noticed that it hasn't been sending email notifications. We have an older version of hesk running (2.5.3 + 2.7.3) with exactly the same email settings and it is working fine.

Our Email Settings are:
SMTP Host: smtp.office365.com
SMTP Port: 587
SMTP Timeout: 20
SSL Protocol: Off
TLS Protocol: On

When testing the email settings on 2.8.2 it says 'Connection successful!' but it comes up with an error when submitting tickets and never actually sends the email. I'm not sure what logs you'd need so if you let me know then I can attach what you need. Sorry for not providing much information - I'm not sure entirely what you'd need.

Re: Email Notifications - Office 365

Posted: Tue Sep 25, 2018 7:08 pm
by Klemen
This is usually a SMTP sender issue. Do you have your "From:" email (admin panel > Settings > General tab) set to the same email as your SMTP email account address? If not, Office365 could be rejecting emails because the SMTP user isn't allowed to send emails with another "From" address set (for example if SMTP user is one@example.com and the From address is two@example.com this will lead to errors).

You can also try and see if you get any additional error details if you enabled debug mode (Settings > Help desk tab > Features > Debug mode) and then viewing the error when submitting a ticket.

Re: Email Notifications - Office 365

Posted: Wed Sep 26, 2018 2:13 pm
by Mazurizi
Thanks for the reply - I can confirm that the from address is the same as my smtp details. Here's a lovely long error message I have from debug mode:

Error: 554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 16.55847:7E1D0000, 17.43559:0000000094000000000000000200000000000000, 20.52176:140F77841100101038020000, 20.50032:140F77848117101044020000, 0.35180:02011330, 255.23226:5A020000, 255.27962:0A000000, 255.27962:0E000000, 255.31418:0201E165, 16.55847:C6000000, 17.43559:0000000068010000000000000200000000000000, 20.52176:140F7784110010100B002900, 20.50032:140F77848117101003003600, 0.35180:C9000000, 255.23226:0A004100, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:0A006400, 4.21921:DC040000, 255.27962:FA000000, 255.1494:E9000000, 0.37692:0F010480, 0.37948:00000000, 5.33852:00000000534D545000010480, 4.56248:DC040000, 7.40748:010000000000010B810BAE2E, 7.57132:000000000000000000000000, 1.63016:32000000, 4.39640:DC040000, 8.45434:68620D6D8198DB46835E3D342472B6D938323A62, 5.10786:0000000031352E32302E313134332E3031373A414D355052303530314D42323438323A62623531336361392D343037312D343662382D626339342D3932356566323631616534620032363161, 255.1750:0B00CD0E, 255.31418:4F010000, 0.22753:0201030F, 255.21817:DC040000, 4.60547:DC040000, 0.21966:6A010000, 4.30158:DC040000 [Hostname=AM5PR0501MB2482.eurprd05.prod.outlook.com]

Re: Email Notifications - Office 365

Posted: Wed Sep 26, 2018 6:45 pm
by Klemen
Gotta love those Microsoft error messages :lol:

The error you got is from Office 365 mail server. From what I understand, your SMTP user is not allowed to send email as the "From" email address. Perhaps you need to use a different user or allow this user to "Send as" someone else?

Office 365 support might be the right address to debug that error message.

Re: Email Notifications - Office 365

Posted: Fri Sep 28, 2018 11:14 am
by Mazurizi
All the settings on the account should be correct as it is sending emails via the old versions of Hesk - it's just the newer version that doesn't seem to work properly.

Is there any way that I can roll back to a previous version of Hesk? Then I'll be able to tell you the version where it stops working.

Re: Email Notifications - Office 365

Posted: Fri Sep 28, 2018 11:35 am
by Klemen
There is no supported way of rolling back (except using a backup).

However, you can download old versions here and install them in a test folder. I am eager to see the results as the email sending code had not changed...

Re: Email Notifications - Office 365

Posted: Fri Sep 28, 2018 12:08 pm
by Mazurizi
Thanks for the support. I rolled back to 2.7.3 and emails are working fine again now. Out of curiousity I tried 2.7.5 and it doesn't work - so it's something between these two versions that stops it from working.

Thanks for your help!

Re: Email Notifications - Office 365

Posted: Fri Sep 28, 2018 1:09 pm
by Klemen
Could you by any chance give me access to your 2.7.5 or 2.8.2 installation so I can test this and see if I can make sense of it? I would need admin access for Hesk and FTP access to Hesk files.

If not no problem.

Re: Email Notifications - Office 365

Posted: Fri Sep 28, 2018 1:12 pm
by Mazurizi
Unfortunately it isn't a publically accessible server, and some confidential information is held on the helpdesk. You should be able to replicate it with the settings listed above though.

Re: Email Notifications - Office 365

Posted: Fri Sep 28, 2018 1:25 pm
by Klemen
It does work normally on my server, that's the "problem" :D

Re: Email Notifications - Office 365

Posted: Fri Sep 28, 2018 1:30 pm
by Mazurizi
Aha I see, that makes even less sense then! It's not even coming up with an error when you submit a ticket? As that is when we get the error - the 'test connectivity' button passes fine - it's just when we submit a ticket it says notifications cannot be sent.

Anything else that you can think of that you'd need? PHP versions or anything like that?

Re: Email Notifications - Office 365

Posted: Fri Sep 28, 2018 1:39 pm
by Klemen
You can send me the results of phpinfo on your server (in a private message):
https://www.phpjunkyard.com/extras/phpinfo.zip

And please let me know what exactly is "From name" and "From email" set to in your help desk.

Re: Email Notifications - Office 365

Posted: Mon Oct 01, 2018 8:44 am
by Mazurizi
Cheers Klemen, I have the PHP Info file - is there any way that I can attach it to a private message or do I need to host it locally and send you the link?

Re: Email Notifications - Office 365

Posted: Tue Oct 02, 2018 4:41 pm
by Klemen
You can send it to kstirn at hesk via email. I am out of the country for a week so it might take a while to get back to you though.