Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added $spamassassin_[dcc,razor2,pyzor,fuzzyocr]_enabled to enable the…

… corresponding plugins
  • Loading branch information...
commit 99c860856240fd6233205e9bec4367f173aadc2c 1 parent 217a49d
nadir authored
Showing with 52 additions and 11 deletions.
  1. +5 −0 README
  2. +31 −11 manifests/init.pp
  3. +16 −0 {files → templates}/debian/v310.pre
5 README
View
@@ -5,6 +5,11 @@ The spamassassin::base class sets up basis spamassassin functionallity.
spamassassin::debian adds fuzzyocr und pyzor support, which are set up as
seperate classes, but are tested on debian until now.
+Config
+------
+- Plugins: Set $spamassassin_[dcc,razor2,pyzor,fuzzyocr]_enabled to true to enable the
+ corresponding plugins
+
Issues
------
- DCC has a non-free license according to debian, so it isn't included in the repository.
42 manifests/init.pp
View
@@ -7,6 +7,25 @@
# modules_dir { "spamassassin": }
+case $spamassassin_dcc_enabled {
+ "": { $spamassassin_dcc_enabled = "false" }
+
+}
+
+case $spamassassin_pyzor_enabled {
+ "": { $spamassassin_pyzor_enabled = "false" }
+}
+
+case $spamassassin_razor2_enabled {
+ "": { $spamassassin_razor2_enabled = "false" }
+}
+
+case $spamassassin_fuzzyocr_enabled {
+ "": { $spamassassin_fuzzyocr_enabled = "false" }
+}
+
+
+
class spamassassin {
case $operatingsystem {
gentoo: { include spamassassin::gentoo }
@@ -16,22 +35,17 @@
}
class spamassassin::base {
- # since spamassassin::base needs Class razor and dcc we include it here
- include razor
- include dcc
+ case $spamassassin_dcc_enabled { "true": { include dcc } }
+ case $spamassassin_razor2_enabled { "true": { include razor } }
package { 'spamassassin':
ensure => installed,
- require => [
- Class[razor],
- Class[dcc]
- ],
}
case $operatingsystem {
debian: {$spamd_servicename = "spamassassin" }
default: {$spamd_servicename="spamd"}
- }
+ }
service{spamd:
@@ -48,8 +62,14 @@
# fuzzyocr and pyzor are included here by default as well as they increase
# the hit-rate
- include fuzzyocr
- include pyzor
+ case $spamassassin_pyzor_enabled { "true": { include pyzor } }
+ case $spamassassin_fuzzyocr_enabled {
+ "true": { include fuzzyocr }
+ default: { file { ["/etc/spamassassin/FuzzyOcr.cf",
+ "/etc/spamassassin/FuzzyOcr.cf.real"] :
+ ensure => absent;}
+ }
+ }
file {"/etc/default/spamassassin":
source => "puppet:///spamassassin/debian/spamassassin",
@@ -66,7 +86,7 @@
}
file {"/etc/spamassassin/v310.pre":
- source => "puppet:///spamassassin/debian/v310.pre",
+ content => template ("spamassassin/debian/v310.pre"),
mode => 0644, owner => root, group => root,
require => Package[spamassassin],
notify => Service[spamassassin];
16 files/debian/v310.pre → templates/debian/v310.pre
View
@@ -1,3 +1,5 @@
+# Managed by Puppet !
+
# This is the right place to customize your installation of SpamAssassin.
#
# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
@@ -21,15 +23,29 @@
# DCC is disabled here because it is not open source. See the DCC
# license for more details.
#
+<% if (spamassassin_dcc_enabled == "true" ) -%>
loadplugin Mail::SpamAssassin::Plugin::DCC
+<% else -%>
+#loadplugin Mail::SpamAssassin::Plugin::DCC
+<% end -%>
# Pyzor - perform Pyzor message checks.
#
+<% if (spamassassin_pyzor_enabled == "true" ) -%>
loadplugin Mail::SpamAssassin::Plugin::Pyzor
+<% else -%>
+#loadplugin Mail::SpamAssassin::Plugin::Pyzor
+<% end -%>
+
# Razor2 - perform Razor2 message checks.
#
+<% if (spamassassin_razor2_enabled == "true" ) -%>
loadplugin Mail::SpamAssassin::Plugin::Razor2
+<% else -%>
+#loadplugin Mail::SpamAssassin::Plugin::Razor2
+<% end -%>
+
# SpamCop - perform SpamCop message reporting
#
Please sign in to comment.
Something went wrong with that request. Please try again.