diff options
author | Jesse Luehrs <doy@tozt.net> | 2017-11-06 02:16:36 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2017-11-06 02:16:36 -0500 |
commit | 280348be23c634cc83a037a49102b71479264525 (patch) | |
tree | d1c5b43f2b9ec69e408c97b5d0ad340dfc2af90b /modules | |
parent | 9dea34f32e9ba21d71d2b30503de5ba487765d88 (diff) | |
download | puppet-tozt-280348be23c634cc83a037a49102b71479264525.tar.gz puppet-tozt-280348be23c634cc83a037a49102b71479264525.zip |
a bit more mail config
Diffstat (limited to 'modules')
-rw-r--r-- | modules/procmail/files/mark_as_read | 20 | ||||
-rw-r--r-- | modules/procmail/files/procmailrc | 19 | ||||
-rw-r--r-- | modules/procmail/manifests/init.pp | 19 | ||||
-rw-r--r-- | modules/spamassassin/files/local.cf | 19 | ||||
-rw-r--r-- | modules/spamassassin/manifests/init.pp | 9 | ||||
-rw-r--r-- | modules/tozt/manifests/mail.pp | 4 |
6 files changed, 89 insertions, 1 deletions
diff --git a/modules/procmail/files/mark_as_read b/modules/procmail/files/mark_as_read new file mode 100644 index 0000000..726c6f5 --- /dev/null +++ b/modules/procmail/files/mark_as_read @@ -0,0 +1,20 @@ +:0 +{ + :0c: + $folder + + :0 + * LASTFOLDER ?? /\/[^/]+$ + { tail=$MATCH } + + file_read_base="${folder}cur/${tail}" + file_new=$LASTFOLDER + # pretty hackish, but what can you do + file_cur="${file_read_base}*" + file_read="${file_read_base}:2,S" + TRAP="mv $file_new $file_read 2>/dev/null || mv $file_cur $file_read 2>/dev/null" + + HOST +} + +# vim:ft=procmail diff --git a/modules/procmail/files/procmailrc b/modules/procmail/files/procmailrc new file mode 100644 index 0000000..7592c05 --- /dev/null +++ b/modules/procmail/files/procmailrc @@ -0,0 +1,19 @@ +DEFAULT=$HOME/Maildir/ +SPAM=${DEFAULT}.spam/ +MAILDIR=$HOME/Maildir/ +PMDIR=$HOME/.procmail +LOGFILE=$PMDIR/log + +DROPPRIVS=yes + +:0fw: spamassassin.lock +| /usr/bin/vendor_perl/spamassassin + +:0 +* ^X-Spam-Flag: YES +{ + folder=$SPAM + SWITCHRC=/etc/procmail/mark_as_read +} + +# vim:ft=procmail diff --git a/modules/procmail/manifests/init.pp b/modules/procmail/manifests/init.pp new file mode 100644 index 0000000..6cb269c --- /dev/null +++ b/modules/procmail/manifests/init.pp @@ -0,0 +1,19 @@ +class procmail { + package { 'procmail': + ensure => installed; + } + + file { + '/etc/procmail': + ensure => directory; + '/etc/procmail/mark_as_read': + source => 'puppet:///modules/procmail/mark_as_read', + require => File['/etc/procmail']; + '/etc/procmailrc': + source => 'puppet:///modules/procmail/procmailrc', + require => [ + Class['spamassassin'], + File['/etc/procmail/mark_as_read'], + ]; + } +} diff --git a/modules/spamassassin/files/local.cf b/modules/spamassassin/files/local.cf new file mode 100644 index 0000000..be57ebf --- /dev/null +++ b/modules/spamassassin/files/local.cf @@ -0,0 +1,19 @@ +report_safe 0 +lock_method flock +required_score 3.5 +use_bayes 1 +bayes_auto_learn 0 + +bayes_ignore_header X-Spam-Checker-Version +bayes_ignore_header X-Spam-Level +bayes_ignore_header X-Spam-Status + +loadplugin Mail::SpamAssassin::Plugin::Shortcircuit +shortcircuit BAYES_99 spam +shortcircuit BAYES_00 ham + +loadplugin Mail::SpamAssassin::Plugin::AWL +header AWL eval:check_from_in_auto_whitelist() +describe AWL From: address is in the auto white-list +tflags AWL userconf noautolearn +priority AWL 1000 diff --git a/modules/spamassassin/manifests/init.pp b/modules/spamassassin/manifests/init.pp new file mode 100644 index 0000000..23c942e --- /dev/null +++ b/modules/spamassassin/manifests/init.pp @@ -0,0 +1,9 @@ +class spamassassin { + package { 'spamassassin': + ensure => installed; + } + + file { '/etc/mail/spamassassin/local.cf': + source => 'puppet:///modules/spamassassin/local.cf'; + } +} diff --git a/modules/tozt/manifests/mail.pp b/modules/tozt/manifests/mail.pp index fd49c7f..5ad7c93 100644 --- a/modules/tozt/manifests/mail.pp +++ b/modules/tozt/manifests/mail.pp @@ -1,8 +1,10 @@ class tozt::mail { include dovecot include postfix + include spamassassin + include procmail - package { ['procmail', 'mutt']: + package { 'mutt': ensure => installed; } } |