mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
SMTP: document why we always load templates in service mode
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
@@ -257,8 +257,11 @@ func (c *Config) Initialize(configDir string, isService bool) error {
|
||||
if !config.isEnabled() {
|
||||
return nil
|
||||
}
|
||||
// If not running as a service, templates will only be loaded if required.
|
||||
return c.loadTemplates(configDir)
|
||||
}
|
||||
// In service mode SMTP can be enabled from the WebAdmin at runtime so we
|
||||
// always load templates.
|
||||
if err := c.loadTemplates(configDir); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user