From ce4a52c22c287b5eec693cee992711b4cbb00321 Mon Sep 17 00:00:00 2001 From: Stephan Sachse Date: Sat, 2 Dec 2017 04:06:49 +0100 Subject: [PATCH] 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" `` 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) --- modules/mailer/mailer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index a54e83617..9741e5130 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -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)