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:
@@ -51,9 +51,6 @@ alias_database = hash:/etc/aliases
|
||||
|
||||
# Dovecot Integration
|
||||
{% if dovecot_enabled | default(false) %}
|
||||
# Use Maildir format
|
||||
home_mailbox = Maildir/
|
||||
|
||||
{% if dovecot_postfix_sasl_enable | default(false) %}
|
||||
# SASL Authentication via Dovecot
|
||||
smtpd_sasl_type = dovecot
|
||||
@@ -62,7 +59,9 @@ smtpd_sasl_auth_enable = yes
|
||||
{% endif %}
|
||||
|
||||
{% if dovecot_postfix_lmtp_enable | default(false) %}
|
||||
# Delivery via LMTP
|
||||
mailbox_transport = lmtp:unix:private/dovecot-lmtp
|
||||
# Virtual mailbox configuration for Dovecot users
|
||||
virtual_mailbox_domains = {{ postfix_mail_domain }}
|
||||
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox_maps
|
||||
virtual_transport = lmtp:unix:private/dovecot-lmtp
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user