Commit Graph

12 Commits

Author SHA1 Message Date
c9892b9e51 feat: configure standard special-use mailboxes in dovecot
Update templates/10-mail.conf.j2 to explicitly define standard mailboxes (Drafts, Junk, Trash, Sent) within the inbox namespace.

This change ensures that:
- These folders are automatically subscribed (`auto = subscribe`).
- They are correctly flagged with `special_use` attributes, improving compatibility with IMAP clients.
- "Sent Messages" is also recognized as a Sent folder for broader client support.
2026-02-10 19:06:41 -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
a24007383d fix(dovecot): use %n instead of %u for username and home path
Update the Dovecot authentication template to use `%n` (user part only)
instead of `%u` (full username) in both the `passdb` username format and
the `userdb` home directory path.

This ensures that user lookups and home directory generation rely specifically
on the username portion, excluding the domain part.
2026-02-10 18:41:44 -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
589d3e0d12 docs: add agent guidelines and update role title in readme
- Create AGENTS.md to define contribution rules, specifically mandating the use of ansible.builtin namespace and ensuring documentation updates.
- Update the README.md header from "Postfix" to "Mail" to align with the repository name.
2026-02-10 17:51:44 -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
e209749f74 fix(dovecot): update auth-userdb listener permissions for postfix
Update the `unix_listener auth-userdb` configuration in `templates/10-master.conf.j2`. This change switches the socket ownership from `vmail` to the `postfix` user and explicitly sets the group to `postfix`.

This ensures that the Postfix service has the necessary permissions to access the Dovecot authentication socket for user lookups.
2026-02-10 17:32:47 -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
2861687888 Merge pull request 'Implement Postfix (basic)' (#2) to fix #1 into main
Reviewed-on: engineering/ansible_role_mailserver#2
2025-07-29 18:56:20 -03:00
98315f8738 #1 - Define postfix_mynetworks as variable to adjust with local nets 2025-07-29 18:53:19 -03:00
347849efa0 #1 - Implement new ansible role for mailserver. Just covering Postfix for now. 2025-07-28 21:08:28 -03:00
6aaacaca40 Initial commit 2025-07-25 17:29:20 -03:00