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.
This commit is contained in:
8
templates/virtual_mailbox_maps.j2
Normal file
8
templates/virtual_mailbox_maps.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
# Virtual mailbox maps for Postfix
|
||||
# Ansible managed: {{ ansible_managed }}
|
||||
# Format: user@domain OK
|
||||
{% if dovecot_users is defined and dovecot_users | length > 0 %}
|
||||
{% for user in dovecot_users %}
|
||||
{{ user.name }}@{{ postfix_mail_domain }} OK
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user