feat(dovecot): add support for configuring imap_capability

This introduces the `dovecot_imap_capability` variable to allow customization of advertised IMAP capabilities.

- Add `dovecot_imap_capability` to `defaults/main.yml` (defaulting to empty).
- Update `templates/dovecot.conf.j2` to conditionally include the `protocol imap` block if the capability string is provided.
- This enables operators to add or remove specific IMAP extensions (e.g., disabling `LITERAL+` or `NOTIFY`) for client compatibility.
This commit is contained in:
2026-02-11 16:36:01 -03:00
parent f76e0a31ae
commit b4930c3c7d
2 changed files with 13 additions and 0 deletions

View File

@@ -45,6 +45,13 @@ dovecot_enabled: true
# Protocols to enable (imap, pop3, lmtp)
dovecot_protocols: "imap pop3 lmtp"
# IMAP capability adjustments. Set to modify advertised IMAP capabilities.
# Use +CAPABILITY to add, -CAPABILITY to remove.
# Example: "+IMAP4rev1 -LITERAL+ -NOTIFY" removes modern extensions that
# might suppress standard untagged responses.
# Leave empty to use Dovecot defaults.
dovecot_imap_capability: ""
# Mail storage location. Using Maildir in the user's home directory.
dovecot_mail_location: "maildir:~/Maildir"

View File

@@ -2,6 +2,12 @@
# Ansible managed: {{ ansible_managed }}
protocols = {{ dovecot_protocols }}
{% if dovecot_imap_capability | default('') | length > 0 %}
protocol imap {
imap_capability = {{ dovecot_imap_capability }}
}
{% endif %}
# Dictionary of configuration files
!include conf.d/*.conf