Sendmail should create a process on the gitea system and have a default timeout (#11256)

* Make sure that sendmail processes register with the process manager
* Provide a timeout for these (initially of 5 minutes)
* Add configurable value and tie in to documentation
* Tie in to the admin config page.

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath 2020-05-03 00:04:31 +01:00 committed by GitHub
parent 319eb83112
commit 4f9d59be17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 4 deletions

View file

@ -6,6 +6,7 @@ package setting
import (
"net/mail"
"time"
"code.gitea.io/gitea/modules/log"
@ -35,8 +36,9 @@ type Mailer struct {
IsTLSEnabled bool
// Sendmail sender
SendmailPath string
SendmailArgs []string
SendmailPath string
SendmailArgs []string
SendmailTimeout time.Duration
}
var (
@ -69,7 +71,8 @@ func newMailService() {
IsTLSEnabled: sec.Key("IS_TLS_ENABLED").MustBool(),
SubjectPrefix: sec.Key("SUBJECT_PREFIX").MustString(""),
SendmailPath: sec.Key("SENDMAIL_PATH").MustString("sendmail"),
SendmailPath: sec.Key("SENDMAIL_PATH").MustString("sendmail"),
SendmailTimeout: sec.Key("SENDMAIL_TIMEOUT").MustDuration(5 * time.Minute),
}
MailService.From = sec.Key("FROM").MustString(MailService.User)