plugins.rb 532 B

123456789101112131415161718192021222324
  1. module Dovecot
  2. module Plugins
  3. def self.required?(plugin, attrs)
  4. return true if attrs.has_key?('mail_plugins') and attrs['mail_plugins'].include?(plugin)
  5. attrs['protocols'].each do |protocol, conf|
  6. return true if conf.has_key?('mail_plugins') and conf['mail_plugins'].include?(plugin)
  7. end
  8. false
  9. end
  10. def self.list_unknown(plugins)
  11. known_plugins = [
  12. 'mail_log',
  13. 'quota',
  14. 'acl',
  15. 'sieve'
  16. ]
  17. plugins.keys - known_plugins
  18. end
  19. end
  20. end