mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-04 10:05:00 +02:00
Add PERMIT_DOCKER=connected-networks
This commit is contained in:
parent
33c85d75ad
commit
234632913e
4 changed files with 35 additions and 3 deletions
|
@ -1016,6 +1016,7 @@ function _setup_docker_permit() {
|
|||
|
||||
container_ip=$(ip addr show eth0 | grep 'inet ' | sed 's/[^0-9\.\/]*//g' | cut -d '/' -f 1)
|
||||
container_network="$(echo $container_ip | cut -d '.' -f1-2).0.0"
|
||||
container_networks=$(ip -o -4 addr show type veth | egrep -o '[0-9\.]+/[0-9]+')
|
||||
|
||||
case $PERMIT_DOCKER in
|
||||
"host" )
|
||||
|
@ -1031,7 +1032,14 @@ function _setup_docker_permit() {
|
|||
echo 172.16.0.0/12 >> /etc/opendmarc/ignore.hosts
|
||||
echo 172.16.0.0/12 >> /etc/opendkim/TrustedHosts
|
||||
;;
|
||||
|
||||
"connected-networks" )
|
||||
for network in $container_networks; do
|
||||
notify 'inf' "Adding docker network $network in my networks"
|
||||
postconf -e "$(postconf | grep '^mynetworks =') $network"
|
||||
echo $network >> /etc/opendmarc/ignore.hosts
|
||||
echo $network >> /etc/opendkim/TrustedHosts
|
||||
done
|
||||
;;
|
||||
* )
|
||||
notify 'inf' "Adding container ip in my networks"
|
||||
postconf -e "$(postconf | grep '^mynetworks =') $container_ip/32"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue