diff --git a/deployments/services/email/Proxmox Mail Gateway/Enabling Direct Unfiltered Communication Between Mailcow and PMG.md b/deployments/services/email/Proxmox Mail Gateway/Enabling Direct Unfiltered Communication Between Mailcow and PMG.md index 306e6b3..1723ab1 100644 --- a/deployments/services/email/Proxmox Mail Gateway/Enabling Direct Unfiltered Communication Between Mailcow and PMG.md +++ b/deployments/services/email/Proxmox Mail Gateway/Enabling Direct Unfiltered Communication Between Mailcow and PMG.md @@ -92,7 +92,9 @@ Configure PMG as a trusted forwarding host in the Mailcow WebUI. ## Configure Postfix Trusted Networks The forwarding-host entry does not replace Postfix `mynetworks`. Add PMG to `mynetworks` so Postfix treats SMTP sessions from PMG as trusted and evaluates `permit_mynetworks` before sender-domain restrictions. -### Inspect the Active Configuration +### Inspect the Existing Trusted Networks +Before modifying `mynetworks`, determine the currently active value. Mailcow automatically populates `mynetworks` with its loopback and Docker networks. Defining your own value replaces that automatically generated configuration, so you must preserve the existing entries. + On the Mailcow host, run: ```sh @@ -100,29 +102,36 @@ cd /opt/mailcow-dockerized docker compose exec postfix-mailcow postconf mynetworks ``` -The validated Bunny Lab configuration is: +Example output: + +```text +mynetworks = 127.0.0.0/8 172.22.1.0/24 [::1]/128 +``` + +At this point, append the PMG address as a single-host CIDR. Do not remove any existing networks. + +Expected result: ```text mynetworks = 127.0.0.0/8 172.22.1.0/24 [::1]/128 192.168.3.15/32 ``` -Preserve every existing loopback and Mailcow Docker network. The PMG address must be appended as a single-host CIDR. - ### Update the Persistent Postfix Override -Edit the Mailcow Postfix override file: + +Edit the Postfix override file: ```sh nano /opt/mailcow-dockerized/data/conf/postfix/extra.cf ``` -Set the complete `mynetworks` value: +If `mynetworks` config line already exists, append the PMG address while preserving the existing values. If the key does not exist, create it using the value discovered in the previous step. ```ini title="/opt/mailcow-dockerized/data/conf/postfix/extra.cf" mynetworks = 127.0.0.0/8 172.22.1.0/24 [::1]/128 192.168.3.15/32 ``` -!!! warning "Preserve Existing Networks" - Defining `mynetworks` replaces the automatically derived value. Do not remove `127.0.0.0/8`, `172.22.1.0/24`, or `[::1]/128` from the validated Bunny Lab configuration. +!!! warning "Do Not Replace Existing Networks" + The `mynetworks` directive replaces Mailcow's automatically generated value. Removing the existing loopback or Docker networks may prevent Postfix from functioning correctly. Always preserve the existing entries and append the PMG address. ### Restart Mailcow Postfix Apply the persistent override: