summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2012-01-14 12:38:50 -0500
committerMicah Anderson <micah@riseup.net>2012-01-14 12:38:50 -0500
commit292f4973548cfee1786b29c5376b9abd1f3cc213 (patch)
treeb7dd7740092a8c994a02607ee847113e75d8dfb7
parent5226583c8c6ecd74d0621b2b61e56ab9f98bcb6c (diff)
add capability to sieve for sequential before/after scripts and ship some default ones
-rw-r--r--files/sieve/after.sieve5
-rw-r--r--files/sieve/before.sieve1
-rw-r--r--manifests/sieve.pp30
3 files changed, 36 insertions, 0 deletions
diff --git a/files/sieve/after.sieve b/files/sieve/after.sieve
new file mode 100644
index 0000000..610d0d1
--- /dev/null
+++ b/files/sieve/after.sieve
@@ -0,0 +1,5 @@
+# for sequential sieve scripts, this one is the after_sieve
+# keep is implicit, but it seems that only explicit fileinto actions
+# are logged and not the implicit keep action, so we specify it explicitly
+fileinto "INBOX";
+stop;
diff --git a/files/sieve/before.sieve b/files/sieve/before.sieve
new file mode 100644
index 0000000..4884529
--- /dev/null
+++ b/files/sieve/before.sieve
@@ -0,0 +1 @@
+# for sequential sieve scripts, this one is the before_sieve
diff --git a/manifests/sieve.pp b/manifests/sieve.pp
index aa7fc3a..f052020 100644
--- a/manifests/sieve.pp
+++ b/manifests/sieve.pp
@@ -32,6 +32,26 @@ class dovecot::sieve {
"puppet:///modules/dovecot/sieve/default.sieve" ],
notify => Exec['compile_default_sieve'],
owner => root, group => root, mode => 0644;
+
+ # this is for sequential sieve scripts, configured in 90-sieve.conf as:
+ # sieve_before = /var/lib/dovecot/sieve/default.sieve
+ "${sieve_location}/before.sieve":
+ source => [ "puppet:///modules/site-dovecot/sieve/${fqdn}/before.sieve",
+ "puppet:///modules/site-dovecot/sieve/before.sieve",
+ "puppet:///modules/dovecot/sieve/${operatingsystem}/before.sieve",
+ "puppet:///modules/dovecot/sieve/before.sieve" ],
+ notify => Exec['compile_before_sieve'],
+ owner => root, group => root, mode => 0644;
+
+ # this is for sequential sieve scripts, configured in 90-sieve.conf as:
+ # sieve_after = /var/lib/dovecot/sieve/after.sieve
+ "${sieve_location}/after.sieve":
+ source => [ "puppet:///modules/site-dovecot/sieve/${fqdn}/after.sieve",
+ "puppet:///modules/site-dovecot/sieve/after.sieve",
+ "puppet:///modules/dovecot/sieve/${operatingsystem}/after.sieve",
+ "puppet:///modules/dovecot/sieve/after.sieve" ],
+ notify => Exec['compile_after_sieve'],
+ owner => root, group => root, mode => 0644;
}
exec {
@@ -40,6 +60,16 @@ class dovecot::sieve {
creates => "${sieve_location}/default.svbin",
require => File["${sieve_location}/default.sieve"];
+ 'compile_before_sieve':
+ command => "sievec ${sieve_location}/before.sieve",
+ creates => "${sieve_location}/before.svbin",
+ require => File["${sieve_location}/before.sieve"];
+
+ 'compile_after_sieve':
+ command => "sievec ${sieve_location}/after.sieve",
+ creates => "${sieve_location}/after.svbin",
+ require => File["${sieve_location}/after.sieve"];
+
'compile_global_sieve':
command => "sievec ${sieve_location}/global/",
refreshonly => true;