Update bind-smtp-network-interface.md

This commit is contained in:
Zlatibor Veljkovic 2025-01-30 00:01:53 +01:00 committed by GitHub
parent e0dcfe1500
commit 80d2cbfc10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,6 +56,27 @@ to the respective IP-address on the server you want to use.
If that avoids the concern with `smtp-amavis`, you may still need to additionally override for the [`relay` transport][gh-src::postfix-master-cf::relay-transport] as well if you have configured DMS to relay mail. If that avoids the concern with `smtp-amavis`, you may still need to additionally override for the [`relay` transport][gh-src::postfix-master-cf::relay-transport] as well if you have configured DMS to relay mail.
=== "Multiple IP hosts"
Sometimes containers use the first IP address from Docker host for outgoing traffic and verifications of rDNS (PTR) can occur for that IP address.
To force container to use specific IP address from host you can use following configuration in compose.yml
```title="compose.yml"
services:
mailserver:
...
networks:
- mailnet
...
networks:
mailnet:
name: mailnet
driver: bridge
driver_opts:
com.docker.network.bridge.host_binding_ipv4: 198.51.100.42
com.docker.network.host_ipv4: 198.51.100.42
```
!!! note "IP addresses for documentation" !!! note "IP addresses for documentation"
IP addresses shown in above examples are placeholders, they are IP addresses reserved for documentation by IANA (_[RFC-5737 (IPv4)][rfc-5737] and [RFC-3849 (IPv6)][rfc-3849]_). Replace them with the IP addresses you want DMS to send mail through. IP addresses shown in above examples are placeholders, they are IP addresses reserved for documentation by IANA (_[RFC-5737 (IPv4)][rfc-5737] and [RFC-3849 (IPv6)][rfc-3849]_). Replace them with the IP addresses you want DMS to send mail through.
@ -67,25 +88,4 @@ to the respective IP-address on the server you want to use.
[gh-pr::3465::alternative-solution]: https://github.com/docker-mailserver/docker-mailserver/pull/3465#issuecomment-1678107233 [gh-pr::3465::alternative-solution]: https://github.com/docker-mailserver/docker-mailserver/pull/3465#issuecomment-1678107233
[gh-src::postfix-master-cf::relay-transport]: https://github.com/docker-mailserver/docker-mailserver/blob/9cdbef2b369fb4fb0f1b4e534da8703daf92abc9/target/postfix/master.cf#L65 [gh-src::postfix-master-cf::relay-transport]: https://github.com/docker-mailserver/docker-mailserver/blob/9cdbef2b369fb4fb0f1b4e534da8703daf92abc9/target/postfix/master.cf#L65
!!! note "Docker compose config for making docker-mailserver use specific outbound IP"
```
services:
mailserver:
image: ghcr.io/docker-mailserver/docker-mailserver:latest
container_name: mailserver
# Provide the FQDN of your mail server here (Your DNS MX record should point to this value)
hostname: REDACTED
env_file: mailserver.env
networks:
- mailnet
...SNIP unrelated
networks:
mailnet:
name: mailnet
driver: bridge
driver_opts:
com.docker.network.bridge.host_binding_ipv4: 203.RED.ACT.ED
com.docker.network.host_ipv4: 203.RED.ACT.ED
```