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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Relay host parameters:
- `RELAYHOST` - Postfix `relayhost`. Default ''. (example `mail.example.com:25`)
- `RELAYHOST_AUTH` - Enable authentication for relayhost. Generally used with `RELAYHOST_PASSWORDMAP`. Default `no`.
- `RELAYHOST_PASSWORDMAP` - relayhost password map in format: `RELAYHOST_PASSWORDMAP=mail1.example.com:user1:pass2,mail2.example.com:user2:pass2`
- `RELAYHOST_PASSWORDMAP_FILE` - relayhost password map file, content is copied into RELAYHOST_PASSWORDMAP. Useful in combination with docker secrets.

Virtual alias map:

Expand Down
10 changes: 10 additions & 0 deletions s6/postfix/run
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ if [ "${RELAYHOST_AUTH}" == "yes" ]; then
postconf -e smtp_sasl_mechanism_filter="PLAIN LOGIN"
fi

if [ -n "${RELAYHOST_PASSWORDMAP_FILE}" ]; then
echo "postfix >> Reading password map file: ${RELAYHOST_PASSWORDMAP_FILE}"
if [ -e "${RELAYHOST_PASSWORDMAP_FILE}" ]; then
RELAYHOST_PASSWORDMAP=$(cat $RELAYHOST_PASSWORDMAP_FILE)
echo "postfix >> Read password map "
else
echo "postfix >> Specified password map file not found!"
fi
fi

if [ -n "${RELAYHOST_PASSWORDMAP}" ]; then
echo "postfix >> Generating relayhost password map"
truncate --size 0 /etc/postfix/sasl-passwords
Expand Down