plugins.rb 605 B

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