From f26d74335fad040464ec9f753a91f8ec91d3b9eb Mon Sep 17 00:00:00 2001 From: Matthias Saou Date: Wed, 4 Apr 2012 11:47:44 +0200 Subject: [PATCH] Add smtpd_sasl_auth support and make spampd more configurable --- modules/postfix/manifests/server.pp | 14 +++++++++++--- modules/postfix/templates/main.cf.erb | 7 +++++++ modules/postfix/templates/sysconfig-spampd.erb | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/modules/postfix/manifests/server.pp b/modules/postfix/manifests/server.pp index b2908a5..e74ef99 100644 --- a/modules/postfix/manifests/server.pp +++ b/modules/postfix/manifests/server.pp @@ -44,7 +44,10 @@ $virtual_transport = false, $smtpd_sender_restrictions = [], $smtpd_recipient_restrictions = [], - $ssl = false, + $ssl = false, + $smtpd_sasl_auth = false, + $smtpd_sasl_type = 'dovecot', + $smtpd_sasl_path = 'private/auth', # master.cf $smtp_content_filter = [], $submission = false, @@ -64,6 +67,11 @@ $sa_skip_rbl_checks = "1", $sa_loadplugin = [ "Mail::SpamAssassin::Plugin::SPF" ], $sa_score = [ "FH_DATE_PAST_20XX 0" ], + $spampd_port = '10026', + $spampd_relayport = '10027', + $spampd_children = '20', + $spampd_maxsize = '512', + # Other filters $postgrey = false, $clamav = false ) { @@ -99,8 +107,8 @@ } # Optional certificates to be installed - if ( $ssl and !defined(Key-and-crt[$ssl]) ) { - key-and-crt { $ssl: } + if ( $ssl and !defined(Tlsfiles[$ssl]) ) { + tlsfiles { $ssl: } } # Optional Spamassassin setup (using spampd) diff --git a/modules/postfix/templates/main.cf.erb b/modules/postfix/templates/main.cf.erb index 9cabda9..bac1186 100644 --- a/modules/postfix/templates/main.cf.erb +++ b/modules/postfix/templates/main.cf.erb @@ -713,6 +713,13 @@ smtpd_tls_loglevel = 1 smtpd_tls_key_file = /etc/pki/tls/private/<%= ssl %>.key smtpd_tls_cert_file = /etc/pki/tls/certs/<%= ssl %>.crt +<% end -%> +<% if smtpd_sasl_auth -%> +# Auth against external daemon (usually dovecot or cyrus) +smtpd_sasl_auth_enable = yes +smtpd_sasl_type = <%= smtpd_sasl_type %> +smtpd_sasl_path = <%= smtpd_sasl_path %> + <% end -%> <% if mail_name -%> # Change the mail daemon name diff --git a/modules/postfix/templates/sysconfig-spampd.erb b/modules/postfix/templates/sysconfig-spampd.erb index daba0bc..1f2aad8 100644 --- a/modules/postfix/templates/sysconfig-spampd.erb +++ b/modules/postfix/templates/sysconfig-spampd.erb @@ -1,2 +1,2 @@ # Options for spampd, since the default ports conflict with other filters... -options="--port=10026 --relayport=10027 --user=spampd --group=spampd --children=20 --maxsize=512 --tagall --log-rules-hit --local-only" +options="--port=<%= spampd_port %> --relayport=<%= spampd_relayport %> --user=spampd --group=spampd --children=<%= spampd_children %> --maxsize=<%= spampd_maxsize %> --tagall --log-rules-hit --local-only"