Implement auto-forward and auto-reply
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
22
dovecot/conf/pigeonhole-sieve.dict
Normal file
22
dovecot/conf/pigeonhole-sieve.dict
Normal 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
|
||||
}
|
||||
BIN
dovecot/dovecot-pigeonhole-plugin-extdata-1-r0.apk
Normal file
BIN
dovecot/dovecot-pigeonhole-plugin-extdata-1-r0.apk
Normal file
Binary file not shown.
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user