Skip to content

Commit

Permalink
Add smtpd_sasl_auth support and make spampd more configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
thias committed Apr 4, 2012
1 parent 94b4259 commit f26d743
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
14 changes: 11 additions & 3 deletions modules/postfix/manifests/server.pp
Expand Up @@ -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,
Expand All @@ -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
) {
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions modules/postfix/templates/main.cf.erb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion 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"

0 comments on commit f26d743

Please sign in to comment.