diff options
author | zeripath <art27@cantab.net> | 2020-05-03 00:04:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-03 00:04:31 +0100 |
commit | 4f9d59be17de6714b33e59d89a64c175aaed9381 (patch) | |
tree | b48c2091b12d8c07ef35618371505194b459ded0 /modules/setting | |
parent | 319eb8311204675aeb9ece3fbb8e25c8b3e8a98b (diff) | |
download | gitea-4f9d59be17de6714b33e59d89a64c175aaed9381.tar.gz gitea-4f9d59be17de6714b33e59d89a64c175aaed9381.zip |
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>
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/mailer.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/setting/mailer.go b/modules/setting/mailer.go index c692e0fe14..a2228e938b 100644 --- a/modules/setting/mailer.go +++ b/modules/setting/mailer.go @@ -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) |