Browse Source

20-pop3.conf.erb template using variables

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

+ 1 - 0
attributes/protocols.rb

@@ -8,4 +8,5 @@ default['dovecot']['protocols']['lda'] = nil
 default['dovecot']['protocols']['imap'] = {}
 default['dovecot']['protocols']['lmtp'] = nil
 default['dovecot']['protocols']['sieve'] = nil
+default['dovecot']['protocols']['pop3'] = nil
 

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

@@ -2,6 +2,9 @@
 ## POP3 specific settings
 ##
 
+<% if @protocols['pop3'].kind_of?(Hash) and @protocols['pop3'].length > 0 -%>
+<%=  Dovecot::Conf.protocol('pop3', @protocols['pop3']) %>
+<% else -%>
 protocol pop3 {
   # Don't try to set mails non-recent or seen with POP3 sessions. This is
   # mostly intended to reduce disk I/O. With maildir it doesn't move files
@@ -84,3 +87,4 @@ protocol pop3 {
   # The list is space-separated.
   #pop3_client_workarounds = 
 }
+<% end -%>