Browse Source

20-lmtp.conf.erb template using variables

Xabier de Zuazo 11 years ago
parent
commit
51f03dc281
2 changed files with 8 additions and 3 deletions
  1. 2 1
      attributes/protocols.rb
  2. 6 2
      templates/default/conf.d/20-lmtp.conf.erb

+ 2 - 1
attributes/protocols.rb

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

+ 6 - 2
templates/default/conf.d/20-lmtp.conf.erb

@@ -3,14 +3,18 @@
 ##
 
 # Support proxying to other LMTP/SMTP servers by performing passdb lookups.
-#lmtp_proxy = no
+<%= Dovecot::Conf.attribute(@conf, 'lmtp_proxy', false) %>
 
 # When recipient address includes the detail (e.g. user+detail), try to save
 # the mail to the detail mailbox. See also recipient_delimiter and
 # lda_mailbox_autocreate settings.
-#lmtp_save_to_detail_mailbox = no
+<%= Dovecot::Conf.attribute(@conf, 'lmtp_save_to_detail_mailbox', false) %>
 
+<% if @protocols['lmtp'].kind_of?(Hash) and @protocols['lmtp'].length > 0 -%>
+<%=  Dovecot::Conf.protocol('lmtp', @protocols['lmtp']) %>
+<% else -%>
 protocol lmtp {
   # Space separated list of plugins to load (default is global mail_plugins).
   #mail_plugins = $mail_plugins
 }
+<% end -%>