7 Commits

Author SHA1 Message Date
d61a4ddcef fix: Dovecot in Debian Trixie => 2.4 has add / deprecated configurations
All checks were successful
Molecule Tests / molecule-tests (pull_request) Successful in 7m18s
2026-03-11 12:40:37 -03:00
f76e0a31ae feat(postfix): implement virtual mailbox configuration for Dovecot LMTP
Updates the Postfix configuration to correctly handle virtual domains when Dovecot LMTP is enabled, moving away from local system delivery settings.

- Removes `postfix_mail_domain` from `postfix_mydestination` to prevent conflicts with virtual domain handling.
- Updates `main.cf` to set `virtual_transport`, `virtual_mailbox_domains`, and `virtual_mailbox_maps` instead of `mailbox_transport`.
- Adds a new template `virtual_mailbox_maps.j2` to authorize specific users defined in `dovecot_users`.
- Adds tasks to generate the virtual mailbox map file and run `postmap` upon changes.
2026-02-11 14:49:22 -03:00
672082cf64 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
2026-02-10 18:48:00 -03:00
e350a39a29 refactor(dovecot): replace template hashing with openssl command
- Add `openssl` to the list of installed packages to ensure CLI availability.
- Introduce a new task to generate user password hashes using `openssl passwd -6` on the target host instead of relying on the Jinja2 `password_hash` filter.
- Update `dovecot-users.j2` template to utilize the registered output from the new OpenSSL task.
- This ensures consistent SHA512-CRYPT hash generation independent of the controller's Python environment or hashing libraries.
2026-02-10 18:10:01 -03:00
dfd5d89905 feat: add support for local dovecot users via passwd-file
This introduces functionality to manage local Dovecot users utilizing a
static `vmail` system user and a flat password file.

Key changes:
- Added `dovecot_users` configuration list to defaults.
- Implemented creation of `vmail` user and group (uid/gid 5000).
- Added logic to generate a random security token using `pwgen` to prefix
  user passwords.
- Created `auth-dovecot-users.conf.ext` and `dovecot-users.j2` templates
  to handle `passwd-file` authentication.
- Updated `10-auth.conf` to include the new local users configuration.
- Updated README with usage instructions and token details.
2026-02-10 17:51:23 -03:00
87ce53d1d3 feat: add support for Dovecot IMAP/POP3 configuration
Introduces functionality to install and configure Dovecot alongside Postfix to provide IMAP/POP3 services.

Changes include:
- Added tasks to install Dovecot packages (core, imapd, pop3d, lmtpd).
- Added templates for main configuration and conf.d files (auth, master, ssl, mail).
- Defined default variables for protocols, SSL settings, and Maildir location.
- Enabled Postfix SASL and LMTP integration options.
- Added a handler to restart the Dovecot service.
- Updated README.md with the new configuration variables and usage instructions.
2026-02-10 17:24:59 -03:00
347849efa0 #1 - Implement new ansible role for mailserver. Just covering Postfix for now. 2025-07-28 21:08:28 -03:00