Skip to content

Commit

Permalink
Merge pull request #7 from kminek/master
Browse files Browse the repository at this point in the history
allow multiple forwards separated by |
  • Loading branch information
huan authored Aug 11, 2016
2 parents a37761b + 3f56ed2 commit 958d28f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit 958d28f

Please sign in to comment.