Browse Source

20-imap.conf.erb template using variables

Xabier de Zuazo 11 years ago
parent
commit
718dd5954f
2 changed files with 6 additions and 2 deletions
  1. 2 2
      attributes/protocols.rb
  2. 4 0
      templates/default/conf.d/20-imap.conf.erb

+ 2 - 2
attributes/protocols.rb

@@ -1,9 +1,9 @@
 
 default['dovecot']['protocols'] = {}
 
-default['dovecot']['protocols']['imap'] = {}
-
 # default['dovecot']['protocols']['lda'] = {
 #   'mail_plugins' => [ '$mail_plugins' ],
 # }
 
+default['dovecot']['protocols']['imap'] = {}
+

+ 4 - 0
templates/default/conf.d/20-imap.conf.erb

@@ -2,6 +2,9 @@
 ## IMAP specific settings
 ##
 
+<% if @protocols['imap'].kind_of?(Hash) and @protocols['imap'].length > 0 -%>
+<%=  Dovecot::Conf.protocol('imap', @protocols['imap']) %>
+<% else -%>
 protocol imap {
   # Maximum IMAP command line length. Some clients generate very long command
   # lines with huge mailboxes, so you may need to raise this if you get
@@ -56,3 +59,4 @@ protocol imap {
   # The list is space-separated.
   #imap_client_workarounds = 
 }
+<% end -%>