Skip to content

Commit

Permalink
Merge branch '22-allow-setting-egress' into 'master'
Browse files Browse the repository at this point in the history
#22:  Allow setting port for smtp egress when used as secondary

See merge request ix.ai/smtp!17
  • Loading branch information
tlex committed Jun 6, 2023
2 parents d2a03d8 + 1b56d87 commit 10ad732
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ The container accepts `OTHER_HOSTNAMES` environment variable which will set the

The container accepts `NET_DEV` environment variable to override the default `eth0` interface for retrieving the IP address for relay networks.

The container accepts `SMTPPORTOUT`environment variable to override the default port of 25 for connecting to the primary mailserver when used as secondary(eg. setting RELAY_DOMAINS)

## Below are scenarios for using this container

### As SMTP Server
Expand Down
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ if [ "$MAILNAME" ]; then
echo "$MAILNAME" > /etc/mailname
fi

if [ "${SMTPPORTOUT}" ]; then
awk -v port_var="${SMTPPORTOUT}" '/remote_smtp:/{ n=NR+2 } NR==n{ $0=" driver = smtp\n port = "port_var }1' /etc/exim4/exim4.conf.template > /etc/exim4/exim4.conf.temp
mv /etc/exim4/exim4.conf.temp /etc/exim4/exim4.conf.template
fi

if [ "$KEY_PATH" ] && [ "$CERTIFICATE_PATH" ]; then
if [ "$MAILNAME" ]; then
echo "MAIN_TLS_ENABLE = yes" >> /etc/exim4/exim4.conf.localmacros
Expand Down

0 comments on commit 10ad732

Please sign in to comment.