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

allow multiple forwards separated by | #7

Merged
merged 2 commits into from
Aug 11, 2016
Merged
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ $ export SMF_CONFIG='[email protected]:[email protected]'
```
> You could get the ESMTP AUTH password for you on your docker log. It's randomly generated if you do not provide one.

You can also forward all emails received by [email protected] to multiple destination addresses:

```bash
$ export SMF_CONFIG='[email protected]:[email protected]|[email protected]|[email protected]'
```

#### 2. Advanced
Add ESMTP AUTH password:
```bash
Expand Down
5 changes: 4 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ function start_postfix {

emailFrom=${emailPair[0]}
emailTo=${emailPair[1]}
emailToArr=(${emailTo//|/ })
emailTo=$(printf "\t%s" "${emailToArr[@]}")
emailTo=${emailTo:1}
tryPassword=${emailPair[2]}

# 1. if user has no password, then use the last seen password from other users.
Expand All @@ -86,7 +89,7 @@ function start_postfix {
echo ">> Setting password[$password] for user $emailFrom ..."
echo $password | saslpasswd2 $emailFrom

newLine=$(printf '%s\t%s' $emailFrom $emailTo)
newLine=$(printf '%s\t%s' $emailFrom "$emailTo")
virtualUsers="${virtualUsers}${newLine}${NEWLINE}"

domainFrom=${emailFrom##*@}
Expand Down