secure_mailing.rb 868 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright (C) 2012-2023 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. result = []
  11. active_backends.each do |backend|
  12. result << "#{backend}::Retry".constantize.process(article)
  13. end
  14. result
  15. end
  16. def self.outgoing(mail, security)
  17. active_backends.each do |backend|
  18. "#{backend}::Outgoing".constantize.process(mail, security)
  19. end
  20. end
  21. def self.security_options(ticket:, article:)
  22. result = []
  23. active_backends.each do |backend|
  24. result << "#{backend}::SecurityOptions".constantize.process(ticket:, article:)
  25. end
  26. result
  27. end
  28. def self.active_backends
  29. backends.select(&:active?)
  30. end
  31. end