unprocessable_mail.rb 488 B

123456789101112131415161718
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module MonitoringHelper
  3. class HealthChecker
  4. class UnprocessableMail < Backend
  5. def run_health_check
  6. return if !File.exist?(Channel::EmailParser::UNPROCESSABLE_MAIL_DIRECTORY)
  7. count = Dir.glob("#{Channel::EmailParser::UNPROCESSABLE_MAIL_DIRECTORY}/*.eml").count
  8. return if count.zero?
  9. response.issues.push "unprocessable mails: #{count}"
  10. end
  11. end
  12. end
  13. end