mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-21 23:20:24 +00:00
smtp: if disabled, bail out before loading templates
Signed-off-by: crabique <crabique@users.noreply.github.com>
This commit is contained in:
parent
12f599fd65
commit
a93ebe36c8
1 changed files with 4 additions and 4 deletions
|
@ -248,7 +248,7 @@ func (c *Config) loadTemplates(configDir string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Initialize initialized and validates the SMTP configuration
|
||||
// Initialize initializes and validates the SMTP configuration
|
||||
func (c *Config) Initialize(configDir string, isService bool) error {
|
||||
if !isService && c.Host == "" {
|
||||
if err := loadConfigFromProvider(); err != nil {
|
||||
|
@ -259,12 +259,12 @@ func (c *Config) Initialize(configDir string, isService bool) error {
|
|||
}
|
||||
return c.loadTemplates(configDir)
|
||||
}
|
||||
if err := c.loadTemplates(configDir); err != nil {
|
||||
return err
|
||||
}
|
||||
if c.Host == "" {
|
||||
return loadConfigFromProvider()
|
||||
}
|
||||
if err := c.loadTemplates(configDir); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := c.validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue