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.
9 lines
272 B
Django/Jinja
9 lines
272 B
Django/Jinja
# 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 %}
|