forked from kevadesu/forgejo
setting: Infer [email.incoming].PORT from .USE_TLS
If `[email.incoming].USE_TLS` is set, but the port isn't, infer the default from `.USE_TLS`: set the port to 993 if using tls, and to 143 otherwise. Explicitly setting a port overrides this. Fixes #3357. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
parent
073cc891c6
commit
0cb46f63df
2 changed files with 68 additions and 9 deletions
|
@ -47,6 +47,15 @@ func loadIncomingEmailFrom(rootCfg ConfigProvider) {
|
|||
IncomingEmail.Password = sec.Key("PASSWD").String()
|
||||
}
|
||||
|
||||
// Infer Port if not set
|
||||
if IncomingEmail.Port == 0 {
|
||||
if IncomingEmail.UseTLS {
|
||||
IncomingEmail.Port = 993
|
||||
} else {
|
||||
IncomingEmail.Port = 143
|
||||
}
|
||||
}
|
||||
|
||||
if err := checkReplyToAddress(IncomingEmail.ReplyToAddress); err != nil {
|
||||
log.Fatal("Invalid incoming_mail.REPLY_TO_ADDRESS (%s): %v", IncomingEmail.ReplyToAddress, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue