Big issue with email loop - Thousand of emails sent to our customer

  • Used Zammad version: 4.0.x
  • Used Zammad installation type: (source, package, docker-compose, …) : package on Ubuntu 20.04
  • Operating system: macOS Catalina 10.15.7
  • Browser + version: Google Chrome Version 91.0.4472.114
  • Number of staff using Zammad : 30
  • Number of emails received and sent per day : 300 to 400

Expected behavior:

  • When you click once on update, emails must be sent by zammad only once

Actual behavior:

  • Sometimes (not all of the time) some emails are sent by zammad hundreds of times or thousands of times, like if there is an endless loop trying to send the email to the recipient

Steps to reproduce the behavior:

  • Try to send an email from zammad to 2 or 3 recipients and join a file that is more than 5 or 6 Mo to the email.
    Our email settings (with SSL) in Zammad are : For Inbound : pop settings / For outbound smtp with port 587

We also have to restart zammad service several times every day, because the email fetching process stop working several times a day.

thanks for your help to solve this matter!

Kind regards.

This is a very specific problem that you must investigate on your system. First thing I would do is check the history of the affected ticket with the menu on the top right Ticket → History to see if Zammad sent out these emails intentionally. If this is the case you could have some kind of error in your Triggers, but I don’t really think this is the case. Next thing to read is your /var/log/zammad/production.log. Everything is logged there so you will most likely find your email issues there. If that doesn’t help you will have to study the logs of your mailserver.

Sounds like you’re sending to the Zammad inbox without knowing.
Zammad just fetches mails from pop - those mails usually are removed after that.
Sometimes depends on your mail servers configuration - nothing we have power on really.

Hi Awedor and Mr Generation, Thanks for your replies. We took a look to our system and to the history of the ticket. I confirm that it was not sent intentionally, because it was sent by a staff member just one time. We don’t use triggers for these kind of emails on Zammad. We also looked the production.log. There are some errors concerning database reconnection, and we then increased max_connections to 300.
The main problem we are facing is that since we begin to use Zammad, we need to restart the service several times a day, because we can see, that Zammad is not sending the emails from our staff and Zammad is not fetching the emails received from customers too until we restart the service. We have to do that several times a day! Do you also think that it can be linked to our mail server? We are using Smartermail as a Mail server software and we can try to configure it properly if somebody can tell us more about what is going probably wrong with our current configuration.

thanks for your help.

You could switch from Pop to Imap for inbound (which is better anyway) and for outbound e-mails you could switch to a local postfix with smarthost set to your mailserver, that’s how I do it. This would make sending the mails more robust in my opinion since Zammad only has to give the mails to postfix and postfix will take care of the delivery to your Smartermail server.
But as I said: your problem is very specific and I don’t think it’s a Zammad problem. You need to investigate thoroughly, a forum can only provide ideas in such a case.
This is my configuration:


zammad1

Thanks Andreas for your suggestion. We already tried with IMAP, but it was worst and we had an error like this one several times a day : [Can’t use Channel::Driver::Imap: #<Net::IMAP::NoResponseError: unsupported search query>]

That’s why we are using pop.
OK we are going to investigate more, but I al sure that something is linked to the fact that we have to restart Zammad service several times a day, because it stop sending outbound emails and fetching inbound emails. After each restart, many emails which were on the spool are sent in few seconds and the emails waiting on the inbox are fetched and imported to zammad. But 2 or 3 hours later we have to restart Zammad service again because the system is blocked again.
We tried to take a look on production.log, but we can not identify where is the error for this problem.
Any Idea for this problem.

Please have a look at the following documentation page to save yourself from future trouble:
https://docs.zammad.org/en/latest/appendix/configure-database-server.html

That doesn’t seem right.
However, above doesn’t really help and sends us into guessing mode.

Check your scheduler_err.log if you believe your scheduler dies.
Possibly this is also an issue with delayed jobs or even performance.

Hard to tell with the given input.

What email server are you using…?