Skip to content

Commit ce4a52c

Browse files
stesachselunny
authored andcommitted
sendmail: correct option to set envelope-sender (#3044)
mailer doesn't set the correct options while calling sendmail. if ``mailer.FROM`` is set to ``"Gitea Webservice" <[email protected]>`` sendmail is called like this ``` Sending with: sendmail [-F [email protected] -i [email protected]] ``` 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)
1 parent 974cffe commit ce4a52c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/mailer/mailer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func (s *sendmailSender) Send(from string, to []string, msg io.WriterTo) error {
208208
var closeError error
209209
var waitError error
210210

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

0 commit comments

Comments
 (0)