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

Refactor postfix::mailman

parent 04c76b10
Branches
Tags v4.3.0
No related merge requests found
...@@ -34,6 +34,7 @@ class postfix ( ...@@ -34,6 +34,7 @@ class postfix (
$mynetworks = undef, # postfix_mynetworks $mynetworks = undef, # postfix_mynetworks
$mta = false, $mta = false,
$satellite = false, $satellite = false,
$mailman = false,
) inherits postfix::params { ) inherits postfix::params {
validate_string($smtp_listen) validate_string($smtp_listen)
...@@ -53,10 +54,16 @@ class postfix ( ...@@ -53,10 +54,16 @@ class postfix (
validate_bool($mta) validate_bool($mta)
validate_bool($satellite) validate_bool($satellite)
validate_bool($mailman)
$_smtp_listen = $mailman ? {
true => '0.0.0.0',
default => $smtp_listen,
}
class { 'postfix::packages': } -> class { 'postfix::packages': } ->
class { 'postfix::files': class { 'postfix::files':
smtp_listen => $smtp_listen, smtp_listen => $_smtp_listen,
root_mail_recipient => $root_mail_recipient, root_mail_recipient => $root_mail_recipient,
use_amavisd => $use_amavisd, use_amavisd => $use_amavisd,
use_dovecot_lda => $use_dovecot_lda, use_dovecot_lda => $use_dovecot_lda,
...@@ -79,4 +86,8 @@ class postfix ( ...@@ -79,4 +86,8 @@ class postfix (
if $satellite { if $satellite {
include ::postfix::satellite include ::postfix::satellite
} }
it $mailman {
include ::postfix::mailman
}
} }
#
# == Class: postfix::mailman # == Class: postfix::mailman
# #
# Configures a basic smtp server, able to work for the mailman mailing-list # Configures a basic smtp server, able to work for the mailman mailing-list
# manager. # manager.
# #
# Parameters:
# - every global variable which works for class 'postfix' will work here.
#
# Example usage: # Example usage:
# #
# node 'toto.example.com' { # node 'toto.example.com' {
# include mailman # class { '::postfix':
# include postfix::mailman # mailman => true,
# }
# } # }
# #
# /!\ Do not include this class directly anymore,
# use mailman => true in the postfix top class!
class postfix::mailman { class postfix::mailman {
$postfix_smtp_listen = '0.0.0.0'
include postfix
postfix::config { postfix::config {
'virtual_alias_maps': 'virtual_alias_maps':
......
require 'spec_helper'
describe 'postfix::mailman' do
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment