secure_mailing.rb 792 B

123456789101112131415161718192021222324252627282930313233
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class SecureMailing
  3. include ::Mixin::HasBackends
  4. def self.incoming(mail)
  5. active_backends.each do |backend|
  6. "#{backend}::Incoming".constantize.process(mail)
  7. end
  8. end
  9. def self.retry(article)
  10. active_backends.map do |backend|
  11. "#{backend}::Retry".constantize.process(article)
  12. end
  13. end
  14. def self.outgoing(mail, security)
  15. active_backends.each do |backend|
  16. "#{backend}::Outgoing".constantize.process(mail, security)
  17. end
  18. end
  19. def self.security_options(ticket:, article:)
  20. active_backends.map do |backend|
  21. "#{backend}::SecurityOptions".constantize.process(ticket:, article:)
  22. end
  23. end
  24. def self.active_backends
  25. backends.select(&:active?)
  26. end
  27. end