1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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
This commit is contained in:
Jonas Bröms
2017-10-25 21:27:25 +02:00
committed by Lauris BH
parent 3af5b67ed0
commit e86a0bf3fe
9 changed files with 322 additions and 0 deletions

View File

@@ -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...)