Set MM_HOSTNAME to hostname -i.

This commit is contained in:
Abhilash Raj
2017-07-23 13:42:36 -07:00
committed by Abhilash Raj
parent 2126bae2a3
commit a7ab6509f1
3 changed files with 7 additions and 5 deletions

View File

@@ -288,7 +288,7 @@ which is typically at `/etc/postfix/main.cf` on Debian based operating
systems:
```
# master.cf
# main.cf
# Support the default VERP delimiter.
recipient_delimiter = +

View File

@@ -40,7 +40,8 @@ These are the variables that you MUST change before deploying:
These are the variables that you don't need to change if you are using a
standard version of docker-compose.yaml from this repository.
- `MM_HOSTNAME`: Default value is `mailman-core`
- `MM_HOSTNAME`: Which IP should Core bind to for REST API and LMTP. If not
defined output for `hostname -i` command is used.
- `SMTP_HOST`: IP Address/hostname from which you will be sending
emails. Default value is `172.19.199.1`, which is the address of the Host OS.

View File

@@ -25,10 +25,11 @@ function wait_for_postgres () {
# Empty the config file.
echo "# This file is autogenerated at container startup." > /etc/mailman.cfg
# Check if $MM_HOSTNAME is set, if not, set it to a default value.
# TODO: Factor this out to a function.
# Check if $MM_HOSTNAME is set, if not, set it to the value returned by
# `hostname -i` command to set it to whatever IP address is assigned to the
# container.
if [[ ! -v MM_HOSTNAME ]]; then
export MM_HOSTNAME='172.19.199.2'
export MM_HOSTNAME=`hostname -i`
fi
if [[ ! -v SMTP_HOST ]]; then