diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-08-25 04:39:44 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-08-25 04:39:44 +0200 |
commit | ec0e483d99200bda02547e425fb5d08697f6156a (patch) | |
tree | 7d35c9e24d96a2c178a0c4d7322ec7dd124db2b2 /cluster/prod/app/email/build/dovecot/legacy | |
parent | ea1b0e9d19d0e1457fa6f6aee593f56d4347ae32 (diff) | |
download | nixcfg-ec0e483d99200bda02547e425fb5d08697f6156a.tar.gz nixcfg-ec0e483d99200bda02547e425fb5d08697f6156a.zip |
Add email support
Diffstat (limited to 'cluster/prod/app/email/build/dovecot/legacy')
4 files changed, 39 insertions, 0 deletions
diff --git a/cluster/prod/app/email/build/dovecot/legacy/all_before.sieve b/cluster/prod/app/email/build/dovecot/legacy/all_before.sieve new file mode 100644 index 0000000..7d2e57e --- /dev/null +++ b/cluster/prod/app/email/build/dovecot/legacy/all_before.sieve @@ -0,0 +1,5 @@ +require ["fileinto", "mailbox"]; +if header :contains "X-Spam-Flag" "YES" { + fileinto :create "Junk"; +} + diff --git a/cluster/prod/app/email/build/dovecot/legacy/dovecot-ldap.sample.conf b/cluster/prod/app/email/build/dovecot/legacy/dovecot-ldap.sample.conf new file mode 100644 index 0000000..472d5e8 --- /dev/null +++ b/cluster/prod/app/email/build/dovecot/legacy/dovecot-ldap.sample.conf @@ -0,0 +1,8 @@ +hosts = ldap.example.com +dn = cn=admin,dc=example,dc=com +dnpass = s3cr3t +base = dc=example,dc=com +scope = subtree +user_filter = (&(mail=%u)(&(objectClass=inetOrgPerson)(memberOf=cn=email,ou=groups,dc=example,dc=com))) +pass_filter = (&(mail=%u)(&(objectClass=inetOrgPerson)(memberOf=cn=email,ou=groups,dc=example,dc=com))) +user_attrs = mail=/var/mail/%{ldap:mail} diff --git a/cluster/prod/app/email/build/dovecot/legacy/report-ham.sieve b/cluster/prod/app/email/build/dovecot/legacy/report-ham.sieve new file mode 100644 index 0000000..c5a994a --- /dev/null +++ b/cluster/prod/app/email/build/dovecot/legacy/report-ham.sieve @@ -0,0 +1,17 @@ +require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables", "vnd.dovecot.debug"]; + +if environment :matches "imap.mailbox" "*" { + set "mailbox" "${1}"; +} + +if string "${mailbox}" "Trash" { + stop; +} + +if environment :matches "imap.user" "*" { + set "username" "${1}"; +} + +pipe :copy "sa-learn" [ "--ham", "-u", "debian-spamd" ]; +debug_log "ham reported by ${username}"; + diff --git a/cluster/prod/app/email/build/dovecot/legacy/report-spam.sieve b/cluster/prod/app/email/build/dovecot/legacy/report-spam.sieve new file mode 100644 index 0000000..1be7389 --- /dev/null +++ b/cluster/prod/app/email/build/dovecot/legacy/report-spam.sieve @@ -0,0 +1,9 @@ +require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables", "vnd.dovecot.debug"]; + +if environment :matches "imap.user" "*" { + set "username" "${1}"; +} + +pipe :copy "sa-learn" [ "--spam", "-u", "debian-spamd"]; +debug_log "spam reported by ${username}"; + |