feat(dovecot): ensure strict permissions on vmail directory

Added a new task to ensure the `/var/vmail` directory exists with specific ownership and permissions.
- Sets owner and group to `vmail`
- Enforces mode `0700` for security
- Applied only when dovecot is enabled
This commit is contained in:
2026-02-10 18:48:00 -03:00
parent a24007383d
commit 672082cf64

View File

@@ -108,6 +108,17 @@
tags:
- dovecot_config
- name: "DOVECOT | Ensure vmail directory permissions"
when: dovecot_enabled | default(false)
ansible.builtin.file:
path: /var/vmail
state: directory
owner: vmail
group: vmail
mode: '0700'
tags:
- dovecot_config
- name: "DOVECOT | Generate user password hashes"
when: dovecot_enabled | default(false) and dovecot_users | length > 0
ansible.builtin.command: