Zammad 6.2 - Microsoft 365 SMTP - Email Notifications Error: Can't use Channel::Driver::Smtp: #<Net::OpenTimeout: execution expired>

Infos:

  • Used Zammad version: 6.2.0-1706286672.4dcb008b.jammy
  • Used Zammad installation type: package
  • Operating system: Ubuntu 22.04.3 LTS (Jammy Jellyfish)
  • Browser + version: Microsoft Edge Version 120.0.2210.144 (Official build) (64-bit)

Expected behavior:

E-mail - Email Notification
Outbound: user@ourdomain.xyz, host: smtp.office365.com, protocol: smtp, port: 587, SSL:on
Notifications should work without errors.

Actual behavior:

ERROR -- : Can't use Channel::Driver::Smtp: #<Net::OpenTimeout: execution expired>
E, [2024-01-27T11:31:30.327995#674-142080] ERROR -- : execution expired (Net::OpenTimeout)
lib/core_ext/net/smtp.rb:12:in `block in do_start'
lib/core_ext/net/smtp.rb:11:in `do_start'
app/models/channel/driver/smtp.rb:98:in `send'
app/models/channel.rb:257:in `deliver'
lib/notification_factory/mailer.rb:172:in `send'
lib/notification_factory/mailer.rb:225:in `notification'
app/models/transaction/notification.rb:217:in `block in perform'
app/models/transaction/notification.rb:106:in `each'
app/models/transaction/notification.rb:106:in `perform'
lib/transaction_dispatcher.rb:61:in `execute_single_backend'
app/jobs/transaction_job.rb:25:in `block in perform'
app/jobs/transaction_job.rb:21:in `perform'
lib/background_services/service/process_delayed_jobs.rb:25:in `block (2 levels) in launch'
lib/background_services/service/process_delayed_jobs.rb:23:in `block in launch'
lib/background_services/service/process_delayed_jobs.rb:20:in `loop'
lib/background_services/service/process_delayed_jobs.rb:20:in `launch'
lib/background_services/service.rb:27:in `block in run'
lib/application_handle_info.rb:19:in `use'
lib/background_services/service.rb:33:in `block in run_in_service_context'
lib/background_services/service.rb:32:in `run_in_service_context'
lib/background_services/service.rb:26:in `run'
lib/background_services.rb:67:in `block in start_as_thread'

Steps to reproduce the behavior:

Situation is strange.
Our Zammad instance was running fine, no such errors up to today, 27-01-2024, when I updated it from slightly earlier 6.2 build with apt update. After Zammad update on first test ticked opened via e-mail I got this error.
When Edit Email Notification Outbound, and just click OK, Error goes away and all systems green.
After discovering SMTP channel error, I checked:

Additional info: we have second Zammad, which was installed about month ago, used same setup/software, but I was able to get notifications running only turning off SSL in Email Outbound. We use two different accounts for these two systems, they send traffic via different public IP’s. And first system was fine up to today with SSL, but second system was “erroring” with SSL from the start. So, second Zammad for now runs with SSL off. Now first system has same issue, as the second one. I am in charge of all network, firewall, etc. so there is no “human miscommunications” problem.
There is no problem with sending-receiving mail from Zammad’s Microsoft 365 mailbox via imap (on both systems).

Please, any ideas/advice how to troubleshoot this issue?

Status update: for now Email notifications works in both Zammad systems with SSL on. I am completely not sure, what we get notified on next opened case.
It looks like “software” has some quite short timeout and no retry attempts (IMHO) on sending mail via smtp.

Again, how this can be checked and possibly tuned, to eliminate such errors?

  • Channel: Microsoft365::Account in Can’t use Channel::Driver::Imap: #<Timeout::Error: execution expired>

Too many intermittent errors…

Did you use a normal email channel or the MS365 channel? (With modern auth) Afaik you have to use the MS365 channel for correct work of the channel. (Unless you do some “dirty” setup like disabling modern auth for your ms account and enabling smtp auth)

For sending E-mail Notifications there is only one method: authenticated SMTP with or without SSL.
And for sending|receiving emails from Microsoft 365 mailbox Zammad must be added as application. etc.
No any “dirty” walkarounds was done.

I see these execution timeouts in SaaS quite regulary. Most often I see this one something in between 11pm and 2am on various instances. Usually in fetching as well as sendout (so if the user is not working it won’t “harm” the sendout). That’s usually fine for the affected instances as those are not working at that time.

As this is a very temporary thing I always suspected connectivity issues, host changes or temporary maintenance on Microsofts end. It also doesn’t happen every night which underlines my guess.

The question is if the connection issue is present for you at the exact same moment Zammad encounters this issue. Zammad channels are self-healing upon the next successful operation. This means the error could have been present for incoming as well, but as it’s fetched every 30s (by default), it naturally clears itself. That’s not the case for outgoing unless you sent an actual email via this channel.

So the monitoring reading may be incorrect at that time you look at it. Not ideal I guess.

Main issue is, what error happens when Zammad send out notifications. And these notifications are not repeated. So, when ticked created, agents does not receive notifications email.

I believe that notifications would retry just like “normal” articles would. Usually the error persists longer than the retry though. I do understand your point but what would be your expactation?