Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,22 @@ You can also forward all emails received by [email protected] to multiple destinat
export SMF_CONFIG='[email protected]:[email protected]|[email protected]|[email protected]'
```

### `SMF_CONFIG_FILE` Examples

If you want to have a config file instead of a config variable
You can add it like:
```bash
cat <EOF > forwards
[email protected]:[email protected]|[email protected]|[email protected]
[email protected]:[email protected]:ThisIsPassword
EOF
```

And then run it:
```bash
docker run -e SMF_CONFIG_FILE=/forwards -v $(pwd)/forwards:/forwards -p 25:25 zixia/simple-mail-forwarder
```

### `SMF_RELAYHOST` Examples

Here's how to configure a relayhost/smarthost to use for forwarding mail.
Expand All @@ -190,6 +206,8 @@ If the `SMF_RELAYHOST` require authentication,
export SMF_RELAYAUTH='[email protected]:RelayHostPassword'
```



TLS (SSL) Certificates
--------------------

Expand Down
12 changes: 12 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ $ docker run -p 25:25 \\
Environment Variables:
SMF_DOMAIN - mail server hostname. use tutum/docker hostname if omitted.
SMF_CONFIG - mail forward addresses mapping list.
SMF_CONFIG_FILE - file name that contain forward adresses mapping list.
SMF_MYNETWORKS - configure relaying from trusted IPs, see http://www.postfix.org/postconf.5.html#mynetworks
SMF_RELAYHOST - configure a relayhost
SMF_SENDERPRIVACY - strips sender's IP, client, and user agent.
Expand Down Expand Up @@ -349,6 +350,17 @@ else
echo ">> END SMF_DOMAIN found. value:[$SMF_DOMAIN]"
fi

if [ "" == "$SMF_CONFIG_FILE" ]; then
echo ">> ENV SMF_CONFIG_FILE not set."
elif [ ! -f "$SMF_CONFIG_FILE" ]; then
echo ">> $SMF_CONFIG_FILE doesn't exists, skipping reading it."
else
echo ">> END SMF_CONFIG_FILE found. value:[$SMF_CONFIG_FILE]"
echo ">> INSERT config file into config var"
SMF_CONFIG=$(cat /$SMF_CONFIG_FILE | tr '\n' ';')
export SMF_CONFIG
fi

if [ "" == "$SMF_CONFIG" ]
then
echo ">> END SMF_CONFIG not set."
Expand Down