Skip to content
Snippets Groups Projects
Commit b7237445 authored by Raphaël Pinson's avatar Raphaël Pinson
Browse files

Use booleans for flags, not yes/no

parent de6c111a
No related branches found
No related tags found
No related merge requests found
...@@ -19,15 +19,20 @@ ...@@ -19,15 +19,20 @@
class postfix ( class postfix (
$smtp_listen = '127.0.0.1', # postfix_smtp_listen $smtp_listen = '127.0.0.1', # postfix_smtp_listen
$root_mail_recipient = 'nobody', # root_mail_recipient $root_mail_recipient = 'nobody', # root_mail_recipient
$use_amavisd = 'no', # postfix_use_amavisd $use_amavisd = false, # postfix_use_amavisd
$use_dovecot_lda = 'no', # postfix_use_dovecot_lda $use_dovecot_lda = false, # postfix_use_dovecot_lda
$use_schleuder = 'no', # postfix_use_schleuder $use_schleuder = false, # postfix_use_schleuder
$use_sympa = 'no', # postfix_use_sympa $use_sympa = false, # postfix_use_sympa
$mail_user = 'vmail', # postfix_mail_user $mail_user = 'vmail', # postfix_mail_user
$myorigin = $::fqdn, $myorigin = $::fqdn,
$inet_interfaces = 'localhost', $inet_interfaces = 'localhost',
) inherits postfix::params { ) inherits postfix::params {
validate_bool($use_amavisd)
validate_bool($use_dovecot_lda)
validate_bool($use_schleuder)
validate_bool($use_sympa)
class { 'postfix::packages': } -> class { 'postfix::packages': } ->
class { 'postfix::files': } ~> class { 'postfix::files': } ~>
class { 'postfix::service': } -> class { 'postfix::service': } ->
......
...@@ -80,10 +80,10 @@ describe 'postfix' do ...@@ -80,10 +80,10 @@ describe 'postfix' do
let (:params) { { let (:params) { {
:smtp_listen => 'all', :smtp_listen => 'all',
:root_mail_recipient => 'foo', :root_mail_recipient => 'foo',
:use_amavisd => 'yes', :use_amavisd => true,
:use_dovecot_lda => 'yes', :use_dovecot_lda => true,
:use_schleuder => 'yes', :use_schleuder => true,
:use_sympa => 'yes', :use_sympa => true,
:mail_user => 'bar', :mail_user => 'bar',
:myorigin => 'localhost', :myorigin => 'localhost',
:inet_interfaces => 'localhost2', :inet_interfaces => 'localhost2',
......
<% if scope.lookupvar('postfix::use_amavisd') == 'yes' %> <% if scope.lookupvar('postfix::use_amavisd') %>
amavis unix - - - - 2 smtp amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200 -o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes -o smtp_send_xforward_command=yes
...@@ -17,15 +17,15 @@ amavis unix - - - - 2 smtp ...@@ -17,15 +17,15 @@ amavis unix - - - - 2 smtp
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-o smtpd_bind_address=127.0.0.1 -o smtpd_bind_address=127.0.0.1
<% end -%> <% end -%>
<% if scope.lookupvar('postfix::use_dovecot_lda') == 'yes' %> <% if scope.lookupvar('postfix::use_dovecot_lda') %>
dovecot unix - n n - - pipe dovecot unix - n n - - pipe
flags=DRhu user=<%= scope.lookupvar('postfix::mail_user') %>:<%= scope.lookupvar('postfix::mail_user') %> argv=/usr/lib/dovecot/deliver -d ${recipient} flags=DRhu user=<%= scope.lookupvar('postfix::mail_user') %>:<%= scope.lookupvar('postfix::mail_user') %> argv=/usr/lib/dovecot/deliver -d ${recipient}
<% end -%> <% end -%>
<% if scope.lookupvar('postfix::use_schleuder') == 'yes' %> <% if scope.lookupvar('postfix::use_schleuder') %>
schleuder unix - n n - - pipe schleuder unix - n n - - pipe
flags=DRhu user=schleuder argv=/usr/bin/schleuder ${user} flags=DRhu user=schleuder argv=/usr/bin/schleuder ${user}
<% end -%> <% end -%>
<% if scope.lookupvar('postfix::use_sympa') == 'yes' %> <% if scope.lookupvar('postfix::use_sympa') %>
sympa unix - n n - - pipe sympa unix - n n - - pipe
flags=R user=sympa argv=/usr/lib/sympa/bin/queue ${recipient} flags=R user=sympa argv=/usr/lib/sympa/bin/queue ${recipient}
sympabounce unix - n n - - pipe sympabounce unix - n n - - pipe
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment