Skip to content

Commit

Permalink
Inject relayhost configuration for postfix
Browse files Browse the repository at this point in the history
Added the ability to inject the relayhost configuration for postfix.
  • Loading branch information
skoranda committed Jun 12, 2019
1 parent afd84cf commit 006433c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions comanage-registry-mailman/postfix/docker-postfix-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion comanage-registry-mailman/postfix/main.cf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = +
Expand Down

0 comments on commit 006433c

Please sign in to comment.