Implement auto-forward and auto-reply

This commit is contained in:
Pierre Jaury
2016-04-20 21:20:02 +02:00
parent d2e6bf01e2
commit 3a4703b764
9 changed files with 85 additions and 4 deletions

View File

@@ -9,6 +9,9 @@ RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/re
dovecot-antispam-plugin@testing \
&& rm -rf /var/cache/apk/*
COPY dovecot-pigeonhole-plugin-extdata-1-r0.apk /
RUN apk add --allow-untrusted --force dovecot-pigeonhole-plugin-extdata-1-r0.apk
COPY conf /etc/dovecot
COPY sieve /var/lib/dovecot

View File

@@ -15,6 +15,10 @@ service dict {
}
}
dict {
sieve = sqlite:/etc/dovecot/pigeonhole-sieve.dict
}
###############
# Mailboxes
###############
@@ -137,7 +141,10 @@ service managesieve-login {
plugin {
sieve_dir = ~/sieve
sieve_plugins = sieve_extdata
sieve_extensions = +vnd.dovecot.extdata
sieve_before = /var/lib/dovecot/before.sieve
sieve_default = /var/lib/dovecot/default.sieve
sieve_after = /var/lib/dovecot/after.sieve
sieve_extdata_dict_uri = proxy::sieve
}

View File

@@ -0,0 +1,22 @@
connect = /data/freeposte.db
map {
pattern = priv/reply_subject
table = user
username_field = address
value_field = reply_subject
}
map {
pattern = priv/reply_body
table = user
username_field = address
value_field = reply_body
}
map {
pattern = priv/forward
table = user
username_field = address
value_field = forward
}

Binary file not shown.

View File

@@ -0,0 +1,14 @@
require ["variables", "vacation", "vnd.dovecot.extdata"];
if string :is "${extdata.reply_subject}" "" {
} else {
vacation :days 1 :subject "${extdata.reply_subject}" "${extdata.reply_body}";
}
if string :is "${extdata.forward}" "" {
} else {
redirect "${extdata.forward}";
keep;
}