Browse Source

90-acl.conf.erb template using variables

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

+ 2 - 0
attributes/plugins.rb

@@ -3,8 +3,10 @@ default['dovecot']['mail_plugins'] = [ 'sieve' ]
 
 default['dovecot']['plugins']['sieve'] = {}
 
+default['dovecot']['plugins']['mail_log'] = nil
 # default['dovecot']['plugins']['mail_log'] = {
 #   'mail_log_events' => 'delete undelete expunge copy mailbox_delete mailbox_rename',
 #   'mail_log_fields' => 'uid box msgid size'
 # }
+default['dovecot']['plugins']['acl'] = nil
 

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

@@ -8,6 +8,9 @@
 # one file for each mailbox, eg. INBOX or sub.mailbox. cache_secs parameter
 # specifies how many seconds to wait between stat()ing dovecot-acl file
 # to see if it changed.
+<% if @plugins.has_key?('acl') and @plugins['acl'].kind_of?(Hash) -%>
+<%=  Dovecot::Conf.plugin('acl', @plugins['acl']) %>
+<% else -%>
 plugin {
   #acl = vfile:/etc/dovecot/global-acls:cache_secs=300
 }
@@ -17,3 +20,4 @@ plugin {
 plugin {
   #acl_shared_dict = file:/var/lib/dovecot/shared-mailboxes
 }
+<% end -%>