unprocessable_mail.rb 466 B

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