Browse Source

90-quota.conf.erb template using variables

Xabier de Zuazo 11 years ago
parent
commit
f0d1d860b2
2 changed files with 5 additions and 0 deletions
  1. 1 0
      attributes/plugins.rb
  2. 4 0
      templates/default/conf.d/90-quota.conf.erb

+ 1 - 0
attributes/plugins.rb

@@ -9,4 +9,5 @@ default['dovecot']['plugins']['mail_log'] = nil
 #   'mail_log_fields' => 'uid box msgid size'
 # }
 default['dovecot']['plugins']['acl'] = nil
+default['dovecot']['plugins']['quota'] = nil
 

+ 4 - 0
templates/default/conf.d/90-quota.conf.erb

@@ -5,6 +5,9 @@
 # Note that you also have to enable quota plugin in mail_plugins setting.
 # <doc/wiki/Quota.txt>
 
+<% if @plugins.has_key?('quota') and @plugins['quota'].kind_of?(Hash) -%>
+<%=  Dovecot::Conf.plugin('quota', @plugins['quota']) %>
+<% else -%>
 ##
 ## Quota limits
 ##
@@ -73,3 +76,4 @@ plugin {
   #quota_rule = *:storage=102400
   #quota2_rule = *:storage=1048576
 }
+<% end -%>