Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to specify passwordmap file #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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