diff --git a/comanage-registry-mailman/postfix/docker-postfix-entrypoint b/comanage-registry-mailman/postfix/docker-postfix-entrypoint index 60a4c03..848e577 100755 --- a/comanage-registry-mailman/postfix/docker-postfix-entrypoint +++ b/comanage-registry-mailman/postfix/docker-postfix-entrypoint @@ -27,6 +27,7 @@ OUTPUT=/dev/stdout injectable_config_vars=( POSTFIX_MYHOSTNAME POSTFIX_MYNETWORKS + POSTFIX_RELAYHOST ) # If the file associated with a configuration variable is present then @@ -61,4 +62,8 @@ sed -i -e s@%%MYHOSTNAME%%@"${MYHOSTNAME}"@ /etc/postfix/main.cf MYNETWORKS=${POSTFIX_MYNETWORKS:-127.0.0.0/8 [::1]/128} sed -i -e s@%%MYNETWORKS%%@"${MYNETWORKS}"@ /etc/postfix/main.cf +# Edit the postfix configuration file in place to set relayhost. +RELAYHOST=${POSTFIX_RELAYHOST:-} +sed -i -e s@%%RELAYHOST%%@"${RELAYHOST}"@ /etc/postfix/main.cf + exec /usr/lib/postfix/sbin/master -c /etc/postfix -d diff --git a/comanage-registry-mailman/postfix/main.cf b/comanage-registry-mailman/postfix/main.cf index 0265ad5..7722558 100644 --- a/comanage-registry-mailman/postfix/main.cf +++ b/comanage-registry-mailman/postfix/main.cf @@ -60,7 +60,7 @@ myhostname = %%MYHOSTNAME%% alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases mydestination = $myhostname -relayhost = +relayhost = %%RELAYHOST%% mynetworks = %%MYNETWORKS%% mailbox_size_limit = 0 recipient_delimiter = +