smtp: require templates only if a server is configured or in service mode

This regression was introduced after recent changes to allow setting the SMTP
settings from the WebAdmin UI.

Fixes #1217

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-03-01 18:31:02 +01:00
parent fad6af11e5
commit 662164c7ff
9 changed files with 104 additions and 82 deletions

View File

@@ -148,7 +148,7 @@ func (s *Service) initializeServices(disableAWSInstallationCode bool) error {
return err
}
smtpConfig := config.GetSMTPConfig()
err = smtpConfig.Initialize(s.ConfigDir)
err = smtpConfig.Initialize(s.ConfigDir, s.PortableMode != 1)
if err != nil {
logger.Error(logSender, "", "unable to initialize SMTP configuration: %v", err)
logger.ErrorToConsole("unable to initialize SMTP configuration: %v", err)