From ca21c7b418eea2061b501750778ca9c952583e74 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 23 Aug 2024 22:08:17 +0100 Subject: More progress on Dovecot ham/spam marking --- ansible/roles/dovecot/tasks/main.yml | 2 + .../dovecot/templates/configs/10-mail.conf.j2 | 2 +- .../dovecot/templates/configs/20-imap.conf.j2 | 105 +++++++++++++++++++++ .../templates/configs/auth-ldap.conf.ext.j2 | 2 +- 4 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 ansible/roles/dovecot/templates/configs/20-imap.conf.j2 (limited to 'ansible') diff --git a/ansible/roles/dovecot/tasks/main.yml b/ansible/roles/dovecot/tasks/main.yml index 6dc5c77..556cfcf 100644 --- a/ansible/roles/dovecot/tasks/main.yml +++ b/ansible/roles/dovecot/tasks/main.yml @@ -146,6 +146,7 @@ sieve_pipe_bin_dir = {{ dovecot_sieve_pipe_bin_dir }} sieve_global_extensions = +vnd.dovecot.pipe sieve_plugins = sieve_imapsieve sieve_extprograms + imapsieve_url = sieve://127.0.0.1:4190 marker: " # {mark} spam & ham autolearning (ansible managed)" state: present notify: @@ -179,6 +180,7 @@ - 10-ssl.conf - 15-mailboxes.conf - 20-lmtp.conf + - 20-imap.conf - auth-ldap.conf.ext tags: - role::dovecot diff --git a/ansible/roles/dovecot/templates/configs/10-mail.conf.j2 b/ansible/roles/dovecot/templates/configs/10-mail.conf.j2 index 891e044..db165df 100644 --- a/ansible/roles/dovecot/templates/configs/10-mail.conf.j2 +++ b/ansible/roles/dovecot/templates/configs/10-mail.conf.j2 @@ -219,7 +219,7 @@ mail_privileged_group = mail # Space separated list of plugins to load for all services. Plugins specific to # IMAP, LDA, etc. are added to this list in their own .conf files. -mail_plugins = welcome +mail_plugins = welcome notify ## ## Mailbox handling optimizations diff --git a/ansible/roles/dovecot/templates/configs/20-imap.conf.j2 b/ansible/roles/dovecot/templates/configs/20-imap.conf.j2 new file mode 100644 index 0000000..615cb86 --- /dev/null +++ b/ansible/roles/dovecot/templates/configs/20-imap.conf.j2 @@ -0,0 +1,105 @@ +# Ansible Managed + +## +## IMAP specific settings +## + +# If nothing happens for this long while client is IDLEing, move the connection +# to imap-hibernate process and close the old imap process. This saves memory, +# because connections use very little memory in imap-hibernate process. The +# downside is that recreating the imap process back uses some resources. +#imap_hibernate_timeout = 0 + +# Maximum IMAP command line length. Some clients generate very long command +# lines with huge mailboxes, so you may need to raise this if you get +# "Too long argument" or "IMAP command line too large" errors often. +#imap_max_line_length = 64k + +# IMAP logout format string: +# %i - total number of bytes read from client +# %o - total number of bytes sent to client +# %{fetch_hdr_count} - Number of mails with mail header data sent to client +# %{fetch_hdr_bytes} - Number of bytes with mail header data sent to client +# %{fetch_body_count} - Number of mails with mail body data sent to client +# %{fetch_body_bytes} - Number of bytes with mail body data sent to client +# %{deleted} - Number of mails where client added \Deleted flag +# %{expunged} - Number of mails that client expunged, which does not +# include automatically expunged mails +# %{autoexpunged} - Number of mails that were automatically expunged after +# client disconnected +# %{trashed} - Number of mails that client copied/moved to the +# special_use=\Trash mailbox. +# %{appended} - Number of mails saved during the session +#imap_logout_format = in=%i out=%o deleted=%{deleted} expunged=%{expunged} \ +# trashed=%{trashed} hdr_count=%{fetch_hdr_count} \ +# hdr_bytes=%{fetch_hdr_bytes} body_count=%{fetch_body_count} \ +# body_bytes=%{fetch_body_bytes} + +# Override the IMAP CAPABILITY response. If the value begins with '+', +# add the given capabilities on top of the defaults (e.g. +XFOO XBAR). +#imap_capability = + +# How long to wait between "OK Still here" notifications when client is +# IDLEing. +#imap_idle_notify_interval = 2 mins + +# ID field names and values to send to clients. Using * as the value makes +# Dovecot use the default value. The following fields have default values +# currently: name, version, os, os-version, support-url, support-email, +# revision. +#imap_id_send = + +# ID fields sent by client to log. * means everything. +#imap_id_log = + +# Workarounds for various client bugs: +# delay-newmail: +# Send EXISTS/RECENT new mail notifications only when replying to NOOP +# and CHECK commands. Some clients ignore them otherwise, for example OSX +# Mail (