Commit dd50140d authored by Raphaël Pinson's avatar Raphaël Pinson
Browse files

Refactor postfix::mailman

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