secure_mailing.rb 656 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2022 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.active_backends
  22. backends.select(&:active?)
  23. end
  24. end