# 365 SMTP Email Issue

**URL:** <https://community.zammad.org/t/365-smtp-email-issue/14416>\
**Category:** Technical assistance\
**Created:** [May 24, 2024, 9:53am UTC](https://community.zammad.org/t/365-smtp-email-issue/14416 "2024-05-24T09:53:59Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![zammad\_user\_2024](https://community.zammad.org/letter_avatar_proxy/v4/letter/z/6de8d8/32.png) [@zammad\_user\_2024](https://community.zammad.org/u/zammad_user_2024)\
**Post date:** [May 24, 2024, 9:53am UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/1 "2024-05-24T09:53:59Z")

</div>

### Infos:

- Used Zammad version: 6.3.0-1715168141.6baf144b.jammy
- Used Zammad installation type: (source, package, docker-compose, …) Package
- Operating system: Ubuntu 22.04.4
- Browser + version: Firefox

### Expected behavior:

- Email sent to customer/user

### Actual behavior:

- Delivery failed: “Unable to send email to 'user@domain.com’: Can’t use Channel::Driver::Smtp: #\<Net::SMTPAuthenticationError: Net::SMTPAuthenticationError\>”

However the agent does receive a notification email. Which leads me to believe this is an internal issue with Zammad. This is a shared mailbox on 365 and I have set SmtpClientAuthenticationDisabled to False.

We also have a local email proxy server. If I can’t find a fix for this error, is there a way to tell Zammad to use the relay for outbound email instead of 365?

---

<div class="post-metadata">

**Author:** ![zammad\_user\_2024](https://community.zammad.org/letter_avatar_proxy/v4/letter/z/6de8d8/32.png) [@zammad\_user\_2024](https://community.zammad.org/u/zammad_user_2024)\
**Post date:** [May 24, 2024, 1:04pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/2 "2024-05-24T13:04:09Z")

</div>

Edit:  
Updated to 6.3.1-1716540828.c7fd5da9.jammy and restarted server but the problem persists.

---

<div class="post-metadata">

**Author:** ![wucherpfennig](https://community.zammad.org/user_avatar/community.zammad.org/wucherpfennig/32/1604_2.png) [@wucherpfennig](https://community.zammad.org/u/wucherpfennig)\
**Post date:** [May 24, 2024, 1:40pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/3 "2024-05-24T13:40:07Z")

</div>

We have this issue from time to time too. Applying the following seems to have helped a bit

[https://admin-docs.zammad.org/en/latest/channels/microsoft365/common-errors.html#missing-permissions-for-the-azure-user](https://admin-docs.zammad.org/en/latest/channels/microsoft365/common-errors.html#missing-permissions-for-the-azure-user)

---

<div class="post-metadata">

**Author:** ![zammad\_user\_2024](https://community.zammad.org/letter_avatar_proxy/v4/letter/z/6de8d8/32.png) [@zammad\_user\_2024](https://community.zammad.org/u/zammad_user_2024)\
**Post date:** [May 24, 2024, 2:33pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/4 "2024-05-24T14:33:28Z")

</div>

Hi thank you for replying.  
Yes I saw that page and have already applied the permission.  
It still does not work correctly.

I don’t understand how the agent can get an update email from Zammad but the user who opened the ticket cannot.

---

<div class="post-metadata">

**Author:** ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)\
**Post date:** [May 24, 2024, 2:38pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/5 "2024-05-24T14:38:08Z")

</div>

Email channels are self healing.  
For that to happen a action has to happen on that channel - so in that case sending an email out should reset the issue state.

> [@zammad\_user\_2024](#):
>
> I don’t understand how the agent can get an update email from Zammad but the user who opened the ticket cannot.

Sounds like a different “issue” / topic and is not exactly good described I’m afraid.

---

<div class="post-metadata">

**Author:** ![zammad\_user\_2024](https://community.zammad.org/letter_avatar_proxy/v4/letter/z/6de8d8/32.png) [@zammad\_user\_2024](https://community.zammad.org/u/zammad_user_2024)\
**Post date:** [May 24, 2024, 2:42pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/6 "2024-05-24T14:42:19Z")

</div>

Thank you.  
For instance I have a ticket open from another email [me2@domain.com](mailto:me2@domain.com).  
I can send an update to the ticket no problem.  
The agent [me@domain.com](mailto:me@domain.com) gets the update email.

If the agent enters an update [me2@domain.com](mailto:me2@domain.com) does not get an email update.  
This was working before we switched to 365.

After a few minutes the error is presented on the ticket and it’s also sent to the agent by email.

Hopefully I’ve explained it more clearly.

---

<div class="post-metadata">

**Author:** ![zammad\_user\_2024](https://community.zammad.org/letter_avatar_proxy/v4/letter/z/6de8d8/32.png) [@zammad\_user\_2024](https://community.zammad.org/u/zammad_user_2024)\
**Post date:** [May 24, 2024, 2:44pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/7 "2024-05-24T14:44:29Z")

</div>

I just tried to update the ticket again and checked the monitoring tab. I see this error:

![image](https://community.zammad.org/uploads/default/original/2X/c/c1364dc8a3ac87887fe0685ddaec06292df52b94.png)

---

<div class="post-metadata">

**Author:** ![zammad\_user\_2024](https://community.zammad.org/letter_avatar_proxy/v4/letter/z/6de8d8/32.png) [@zammad\_user\_2024](https://community.zammad.org/u/zammad_user_2024)\
**Post date:** [May 24, 2024, 2:57pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/8 "2024-05-24T14:57:31Z")

</div>

I also did a message trace in 365 and can see that an email was sent to:  
[verify-external-smtp-sending@discard.zammad.org](mailto:verify-external-smtp-sending@discard.zammad.org)

---

<div class="post-metadata">

**Author:** ![zammad\_user\_2024](https://community.zammad.org/letter_avatar_proxy/v4/letter/z/6de8d8/32.png) [@zammad\_user\_2024](https://community.zammad.org/u/zammad_user_2024)\
**Post date:** [May 24, 2024, 3:24pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/9 "2024-05-24T15:24:35Z")

</div>

Solved!

I was able to figure it out by looking through the production.log file.

First of all I had my email in the 365 Accounts but it was disabled.  
I had done this because I wanted to use a shared mailbox to send and receive the helpdesk emails.  
This seemed to be the only way I was able to add the shared mailbox as a 365 Account to Zammad.

So I deleted my email account from there and the error then stopped coming up.  
However the email was still not being sent to the end user.

Then I found in the log that the group the agent was in did not have an email address assigned to it.

After correcting that everything seems to be working properly now.

Thank you for the assistance.

---

<div class="post-metadata">

**Author:** ![Martin-Bonn](https://community.zammad.org/user_avatar/community.zammad.org/martin-bonn/32/5977_2.png) [@Martin-Bonn](https://community.zammad.org/u/Martin-Bonn)\
**Post date:** [May 24, 2024, 3:51pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/10 "2024-05-24T15:51:27Z")

</div>

I would still not send via Office 365. Zammad does not have a resent / retry feature on failure. If your external connection is down or Exchange Online has an hick-up, you will need to repeat all failed outgoing mail manually.

I use the local MTA to queue and send the mails out. See here [Allow selecting local MTA for outgoing mails in the Microsoft365 channel - #2 by MrGeneration](https://community.zammad.org/t/allow-selecting-local-mta-for-outgoing-mails-in-the-microsoft365-channel/9812/2)

---

<div class="post-metadata">

**Author:** ![zammad\_user\_2024](https://community.zammad.org/letter_avatar_proxy/v4/letter/z/6de8d8/32.png) [@zammad\_user\_2024](https://community.zammad.org/u/zammad_user_2024)\
**Post date:** [May 24, 2024, 4:10pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/11 "2024-05-24T16:10:07Z")

</div>

Thank you for the suggestion.  
I do have my local email relay selected on the Email Channel tab for Outbound Email Notification.  
My local relay is another Ubuntu server with sendmail running on it.

Does this accomplish the same thing?  
Or are the Email Channel settings ignored when using the 365 connector?

---

<div class="post-metadata">

**Author:** ![zammad\_user\_2024](https://community.zammad.org/letter_avatar_proxy/v4/letter/z/6de8d8/32.png) [@zammad\_user\_2024](https://community.zammad.org/u/zammad_user_2024)\
**Post date:** [May 24, 2024, 5:35pm UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/12 "2024-05-24T17:35:06Z")

</div>

I checked the log on the relay and it seems only some of the email is going through.  
I suspect based on the behavior I was seeing that the alerts to agents may be using the email tab and not the 365 tab settings?

So the next question is could your solution of using the local MTA instead be changed to use the relay I have configured on my other server?

Or I suppose I could have the local MTA forward to my relay server as well.

Also, are there any kind of issues with using the config you mentioned?  
I’m thinking about something like settings being reverted on updates.  
Or anything else you have encountered after beginning to use the local MTA.

Thanks

---

<div class="post-metadata">

**Author:** ![Martin-Bonn](https://community.zammad.org/user_avatar/community.zammad.org/martin-bonn/32/5977_2.png) [@Martin-Bonn](https://community.zammad.org/u/Martin-Bonn)\
**Post date:** [May 27, 2024, 8:47am UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/13 "2024-05-27T08:47:14Z")

</div>

Yes, when you use the M365 Channel, notifications are still configured in the E-Mail channel.

> So the next question is could your solution of using the local MTA instead be changed to use the relay I have configured on my other server?

Probably. The M365 channel is basically a special mail channel with some fixed settings like outgoing SMTP. You could try: configure SMTP in the Mail-Channel and see what the options[“outbound”] property of the mail Channel object shows. Change the M365 Channel object accordingly.

> Also, are there any kind of issues with using the config you mentioned?

We have been using this setup for nearly two years, no problems at all of any kind, just make sure Zammad max mail/attachment size and the one configured in the MTA are in line. We have been using this setup over multiple minor version updates and the major update 5.x to 6.x and the setting has always been retained. Still I check after every update just to be sure. I don’t think there will be problems as long as there is no major change in the channel architecture.

---

<div class="post-metadata">

**Author:** ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)\
**Post date:** [June 3, 2024, 8:48am UTC](https://community.zammad.org/t/365-smtp-email-issue/14416/14 "2024-06-03T08:48:02Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
