From e86a0bf3feab82c1b3439806245083dffb2f37c9 Mon Sep 17 00:00:00 2001 From: Jonas Bröms Date: Wed, 25 Oct 2017 21:27:25 +0200 Subject: Add support for extra sendmail arguments (#2731) * Add support for extra sendmail arguments * Sendmail args to exec.command should be a list * Add go-shellquote package * Use go-shellquote lib for parsing Sendmail args * Only parse if sendmail is configured --- modules/mailer/mailer.go | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/mailer') diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index 0bb78de92a..a54e836173 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -209,6 +209,7 @@ func (s *sendmailSender) Send(from string, to []string, msg io.WriterTo) error { var waitError error 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) cmd := exec.Command(setting.MailService.SendmailPath, args...) -- cgit v1.2.3