Skip to content

Commit

Permalink
sendmail: correct option to set envelope-sender (#3044)
Browse files Browse the repository at this point in the history
mailer doesn't set the correct options while calling sendmail. if
``mailer.FROM`` is set to ``"Gitea Webservice" <user@example.com>``
sendmail is called like this

```
Sending with: sendmail [-F user@example.com -i alice@example.com]
```

and doesn't set the envelope-sender. the option ``-F string`` set the
sender full name and is used only with messages that has no ``From``
message header.

set the envelope sender address with ``-f sender`` (lowercase ``f``)
works for me (fedora 27, x86_64, postfix-3.2.4, go1.9.1, gitea-1.3.0)
  • Loading branch information
stesachse authored and lunny committed Dec 2, 2017
1 parent 974cffe commit ce4a52c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/mailer/mailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (s *sendmailSender) Send(from string, to []string, msg io.WriterTo) error {
var closeError error
var waitError error

args := []string{"-F", from, "-i"}
args := []string{"-f", from, "-i"}
args = append(args, setting.MailService.SendmailArgs...)
args = append(args, to...)
log.Trace("Sending with: %s %v", setting.MailService.SendmailPath, args)
Expand Down

0 comments on commit ce4a52c

Please sign in to comment.