]> gitweb.fluxo.info Git - puppet-mail.git/commitdiff
Managing spamassassin
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 13 Sep 2010 00:52:38 +0000 (21:52 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 13 Sep 2010 00:52:38 +0000 (21:52 -0300)
files/spamassassin/default [new file with mode: 0644]
manifests/amavisd.pp
manifests/spamassassin.pp [new file with mode: 0644]
manifests/system.pp

diff --git a/files/spamassassin/default b/files/spamassassin/default
new file mode 100644 (file)
index 0000000..dc44da0
--- /dev/null
@@ -0,0 +1,31 @@
+# /etc/default/spamassassin
+# Duncan Findlay
+
+# WARNING: please read README.spamd before using.
+# There may be security risks.
+
+# Change to one to enable spamd
+ENABLED=1
+
+# Options
+# See man spamd for possible options. The -d option is automatically added.
+
+# SpamAssassin uses a preforking model, so be careful! You need to
+# make sure --max-children is not set to anything higher than 5,
+# unless you know what you're doing.
+
+OPTIONS="--create-prefs --max-children 5 --helper-home-dir"
+
+# Pid file
+# Where should spamd write its PID to file? If you use the -u or
+# --username option above, this needs to be writable by that user.
+# Otherwise, the init script will not be able to shut spamd down.
+PIDFILE="/var/run/spamd.pid"
+
+# Set nice level of spamd
+#NICE="--nicelevel 15"
+
+# Cronjob
+# Set to anything but 0 to enable the cron job to automatically update
+# spamassassin's rules on a nightly basis
+CRON=0
index 8617918d4587e83c76378410f0a7e515d5b32739..7c0bcb0d6a5650cf76b820a238b01ca0e13f9664 100644 (file)
@@ -1,7 +1,7 @@
 class mail::amavisd {
   service { "amavisd":
     ensure  => running,
-    require => Package['amavisd-new'],
+    require => [ Package['amavisd-new'], Service['clamav-daemon', 'spamassassin'] ],
   }
 
   service { "freshclam":
diff --git a/manifests/spamassassin.pp b/manifests/spamassassin.pp
new file mode 100644 (file)
index 0000000..a7d387b
--- /dev/null
@@ -0,0 +1,16 @@
+class mail::spamassassin {
+  file { '/etc/default/spamassassin':
+    ensure  => present,
+    owner  => root,
+    group  => root,
+    mode   => 0644,
+    source => "puppet:///modules/mail/spamassassin/default",
+    require => Package['spamassassin'],
+  }
+
+  service { 'spamassassin':
+    ensure  => running,
+    enabled => true,
+    require => File['/etc/default/spamassassin'],
+  }
+}
index bea848a6be98afed30c4958634787fd55fcc7981..9a67de4e4723b4dda7692e4471dc4839f8cd59cd 100644 (file)
@@ -25,6 +25,7 @@ class mail::system {
   include mail::amavisd
   include mail::header_checks
   include mail::clamav
+  include mail::spamassassin
 
   # Virtual mail system
   case $mail_virtual {