-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple emails are sent #3632
Comments
Your FreeScout version? |
1.8.115 |
Check errors in laravel logs in Manage > Logs > App Logs. |
Events: Error sending email to customer |
Try to manually restart background jobs: https://github.com/freescout-helpdesk/freescout/wiki/Background-Jobs |
Initially, I was using swiftmail() for mailing and the queued job processed properly. But now I am using sendmail(), and then this problem arises. Whenever, we reply to any email. The mail sent successfully, but it also sent to Background Jobs: Queued Job. Here, number of attempts is increases iteratively after every attempts (retries). and therefore, for every attempts we receive multiple emails. Here, attempts should be = 0 ( if mail sent successfully) but it is not equal to zero. It is increase by 1. It doesn't receive signal/message that mail sent, so for every retry it receive signal mail not sent and then it retry again and again. |
Is there anything in "Manage > Logs > Send Errors" or "Manage > Logs > Outgoing Emails"? |
Yes
Outgoing Emails : Accepted for delivery Send Error : |
Very strange. In the latest version of FreeScout if something happens during mail sending there should be a corresponding error message in some log. |
The logs are generated only after the job is failed after 100 attempts.. do you have any solution where after sending mail the job should be finished or closed.. |
This is how it works (at least for others). You may need to find someone who can investigate it on your server. https://github.com/freescout-helpdesk/freescout/wiki/Debugging |
Yet, not found any solution. PHP version: PHP 8.1.2-1ubuntu2.14 Well, we are facing this issue since 2 weeks. All the Emails are sent mutiple times to receivers. Usually, when we send any email to customer or do reply to customer, email sent succesfully but also it is sent in system background jobs queued:jonb. Here it send repetedly to customer for 100 retries and then it send to failed queued:job. But , there is no log in outgoing emails: ( 9th jan 2024 log is empty) Laravel log also has no entries to this emails. Send Error log: App\jobs\sendreplytocustomer has been attempted too many times or run too long. I also increased the retry_time, debug kernel.php and SystemController.php, but nothing worked. Kindly provide useful solution. |
Make sure your console PHP is able to write to /storage/logs directory. |
logs are working. |
Today, we encountered a recurring issue with our system configuration. Specifically, we are running PHP version 7.4 alongside Freescout version 1.8.117. The problem arose when an email was inexplicably sent around 30 times to a single recipient, causing a bottleneck in the job queue and hindering the execution of other tasks. The outgoing mail.log of Freescout did not reference this email duplication issue, but upon investigation, we identified the incident in the mail.log of the Postfix SMTP server. We manually removed the problematic job from the queue, subsequently allowing the seamless execution of the remaining tasks in the queue. We had that exact problem twice. When trying to run the job queue manually with a "hanging job" it times out. Logs are working as expected, and we get proper messages for that in the systems log. |
@cymuc What the time interval between sent emails? Do you have CC or BCC in those emails? |
The time interval is 2 minutes because that is the time interval in the cron job. It was a mail forwarding job with an attachment. No CC or BCC. But there were other mail forwarding jobs with attachments that worked just fine after that. It looks like it is doing part of the job, but then after the email is sent, something hangs and times out. The process is then killed and no sending is reported anywhere. The failed attempts were reported to the database. |
The thing is that emails to customers are being sent by the |
The job would still hang. Even if I try to run the job in the console. It would also not go to the second job. It has nothing to do with the interval. |
Are you all using Docker? Do you have Do you have "IMAP Folder To Save Outgoing Replies" value set in mailbox "Fetching Emails"? If yes try to remove it. |
Agreed, #3706 is a duplicate of this.
I have that every minute since the initial email got sent - in this case 21 times over 21 minutes. (the first time this occurred, we had a report of 84 emails getting sent out). As per other issue, we are running in Docker. |
Incidentally, each time this has happened theres been a log entry at the start of the day some hours before:
May or may not be relevant. |
In my case, it is not running on docker. There is no error message in the logs since the process was killed. There is also no sent log in Freescout, but I can see it in the outgoing message in the postfix mail.log. The allowed memory for php-cli which is relevant for the cron job is memory_limit = -1. |
What about other questions? #3632 (comment) |
Do you have smtp_queue_id field in send_logs table? We had that incident twice in about 6 months. |
And since when and how often does it happen for others? It may help us to identify the commit which could have brought the issue. |
We had it for the first time on January 4th and then again on January 18th. And the problem disappears when we delete the hanging job from the database job table. |
|
I'm also running into this while using a private email server using IMAP and SMTP settings that seem to be verified. |
I have just added the logging file - so hopefully I shall have more to report on when next we start sending multiple emails. This is getting critical now.
|
Interestingly, the email thread that caused the issue today was responded to, and the following logs generated post the updated logging file provided. Looks like it caused an issue saving to the sent Imap folder (we're sending via AWS SES).
|
I've disabled saving sent emails to the IMAP folder and it still happens intermittently. |
This log #3632 (comment) does not show that the We need a log for the |
while checking AWS logs found the issue as Jan 10 10:00:01 ip- sm-msp-queue[1751844]: My unqualified host name (ip-) unknown; sleeping for retry updated configuration provided in following link.. the issue is resolved now.. but it may be different for different users. |
Curious, where did you find the logs in AWS? I've been hunting for them for a while. |
Logs created by the application server are stored locally on individual instances. We retrieved them by using the environment management console. |
nehasri12 Thanks for the info. So in your case do you have "IMAP Folder To Save Outgoing Replies" option set for the mailbox? |
I have disabled "IMAP Folder to Save Outgoing Replies" and it just happened again to a customer who received over 600 duplicate mails. They were not amused :( |
Did you clear cache after doing so? I did the same thing, in fact I added it in again a day later, clearing cache each time and I'm not seeing even the memory exhausted errors I was seeing - so far no dupes |
I have cleared the cache before it happened again and after I disabled the IMAP folder for outgoing mails. Are those affected all using M365 and AWS SES? |
Yes in my case. |
Yes. |
Not in our case. It is a self-hosted Exchange Server and Hosted Ubuntu the Intranet using Hyper-V. |
And you aren't using AWS SES to send out emails, are you? |
No. We are using a local postfix with Smarthost. |
I am using SMTP with M365. And have set "IMAP Folder To Save Outgoing Replies". |
We still have not received requested logs: |
I myself am having a hard time capturing a where this happens consistently. I'm not even sure if its the same problem so maybe I'll step out. |
If someone can reproduce it consistently and can provide access to your FreeScout, please email at [email protected] |
I wouldn't mind giving access if it helps to find the cause. However, it happens intermittently, sometimes not for a week and then a few times in a row. |
We've made some adjustments. You can wait for it to be released or copy 2 following files to your FreeScout, clear cache and see how it goes: https://github.com/freescout-helpdesk/freescout/blob/master/app/Thread.php Don't forget to update FreeScout to the latest version first. |
While sending mail, Job processed successfully once but it also send to Background Process: Queued jobs. From Queued jobs, it is not cleaned automatically, and perform same job again and again (retry) after 90 seconds. Therefore, we received multiple email for 1 job only.
The text was updated successfully, but these errors were encountered: