Add global email delivery spam processing.
This commit is contained in:
parent
be351a6538
commit
188d410ea3
|
@ -18,7 +18,20 @@ dovecot_conf:
|
||||||
- mode: 0644
|
- mode: 0644
|
||||||
- names:
|
- names:
|
||||||
- /etc/dovecot/local.conf:
|
- /etc/dovecot/local.conf:
|
||||||
- source: salt://email/dovecot_local.conf
|
- source: salt://email/dovecot/dovecot_local.conf
|
||||||
|
|
||||||
|
sieve_conf:
|
||||||
|
file.recurse:
|
||||||
|
- name: /var/lib/dovecot/sieve-before.d
|
||||||
|
- dir_mode: '0755'
|
||||||
|
- file_mode: '0644'
|
||||||
|
- source: salt://email/dovecot/sieve-before.d
|
||||||
|
|
||||||
|
sieve_conf_compile:
|
||||||
|
cmd.run:
|
||||||
|
- name: for i in /var/lib/dovecot/sieve-before.d/*.sieve; do sievec $i; done
|
||||||
|
- onchanges:
|
||||||
|
- file: sieve_conf
|
||||||
|
|
||||||
dovecot_service:
|
dovecot_service:
|
||||||
service.running:
|
service.running:
|
||||||
|
|
|
@ -25,3 +25,8 @@ service auth {
|
||||||
group = Debian-exim
|
group = Debian-exim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Sieve. Enable global spam handling.
|
||||||
|
plugin {
|
||||||
|
sieve_before = /var/lib/dovecot/sieve-before.d/
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
require ["fileinfo"]
|
||||||
|
|
||||||
|
# Handle rspamd output
|
||||||
|
if header :contains "X-Spam-Status" "Yes"
|
||||||
|
{
|
||||||
|
fileinto :create "Spam";
|
||||||
|
stop;
|
||||||
|
}
|
||||||
|
if exists ["X-Spam-Bar"]
|
||||||
|
{
|
||||||
|
fileinto :create "Spam.ToClassify";
|
||||||
|
stop;
|
||||||
|
}
|
Loading…
Reference in New Issue