-
Notifications
You must be signed in to change notification settings - Fork 730
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
health checker: add missing check for oversized mails #4727
Conversation
the health checker endpoint only reported unprocessable mails, but not oversized mails that made custom monitoring solutions necessary, or - if not present - could lead to undetected operational issues this adds a check if (and how many) oversized mails are present in the OVERSIZED_MAIL directory with mails present in the oversized mails directory, the health check output now looks like: {"healthy":false,"message":"oversized mails: 4","issues":["oversized mails: 4"],"actions":[]} see also https://community.zammad.org/t/new-unprocessable-mail-directory-does-not-exist-on-zammad-6/11787
e2f6a21
to
96fd140
Compare
@mgruner Maybe something you can check? |
Nice work! :) In addition: IMO the health check should only complain if |
The problem with that setting is that it doesn't seem to have an effect on the storage side. I believe I pointed that out somewhen in the past without success. |
@martini why do you think so? The health check should not need to verify the setting, but looking at the directory should be enough. If something is there, it needs to complain, no matter what the setting was changed to. |
@MrGeneration looking at the code, it appears to have this logic:
If that behaviour is not useful, we should open another issue to describe a better way. Let's not hijack this issue at hand, which is about monitoring (only). |
I think I have to go further and bring more light into the darkness. Ahead: @sebix many thanks for the MR On the functionality - historical background:
Important: Emails larger than Problem: This had the problem that neither an admin nor a customer was notified about the email "left in the mailbox".
Important: The oversized email will be downloaded/deleted from the mailbox. The customer will receive an auto-responder/postmaster email. And the oversized email is created as a copy in For downward compatibility reasons the setting
Summary: If emails are located under @sebix : I hope I could bring light into the darkness. My question now would be what are your backgrounds for the MR to better understand your problem. Thanks for response! |
Thanks to everyone for the reactions!
Our motivation is the same as @mgruner's: Zammad dumps files somewhere and never cleans them up, and the operator never gets a notice. This could fill up the disk. Either we write our own script to remove those emails on a regular basis, or we get a notification from Zammad's health check to have a look (or both). In https://community.zammad.org/t/new-unprocessable-mail-directory-does-not-exist-on-zammad-6/11787 we discussed this matter, the result was that the health check misses the oversized mails and in contrast, covers the unprocessable mails (Storing the large - too large - mails could you actually make vulnerable, but that's very theoretical.) |
Are there any open questions? |
Cleaning up is definitively a must and so I strongly believe that Zammad should indicate there's messages in said folder. |
I forgot to submit my note. If |
Is this a pre-condition for merging this PR? And if yes, do you prefer to put that change in here or a separate PR?
If |
If So IMO we just need to remove one lines https://github.com/zammad/zammad/blob/develop/app/models/channel/email_parser.rb#L530C13-L530C13 to not save oversized emails under Just to be sure: @mgruner @MrGeneration anything against this approach (not storing oversized emails under |
@martini that seems to be a valid choice. I can implement this small change. |
Thank you for implementing this change. Looking forward for the next release containing this fix :) |
the health checker endpoint only reported unprocessable mails, but not oversized mails that made custom monitoring solutions necessary, or - if not present - could lead to undetected operational issues this adds a check if (and how many) oversized mails are present in the OVERSIZED_MAIL directory
with mails present in the oversized mails directory, the health check output now looks like:
{"healthy":false,"message":"oversized mails: 4","issues":["oversized mails: 4"],"actions":[]}
see also https://community.zammad.org/t/new-unprocessable-mail-directory-does-not-exist-on-zammad-6/11787