diff --git a/config.go b/config.go index 0b09ff0..6297ba9 100644 --- a/config.go +++ b/config.go @@ -42,6 +42,10 @@ func (c *Config) Load() error { return err } + if *debugFlag { + log.Printf("Config.Load :\r\n%v", cfg) + } + l, err := time.LoadLocation(cfg.Timezone) if err != nil { if *debugFlag { @@ -50,11 +54,25 @@ func (c *Config) Load() error { return err } - if len(cfg.Email.smtpHost) == 0 || len(cfg.Email.fromEmail) == 0 || len(cfg.Email.toEmail) == 0 { + if len(cfg.Email.smtpHost) == 0 { if *debugFlag { - log.Printf("Config.Load : no email") + log.Printf("Config.Load : no smtp") } - return fmt.Errorf("no email") + return fmt.Errorf("no smtp") + } + + if len(cfg.Email.fromEmail) == 0 { + if *debugFlag { + log.Printf("Config.Load : no email from") + } + return fmt.Errorf("no email from") + } + + if len(cfg.Email.toEmail) == 0 { + if *debugFlag { + log.Printf("Config.Load : no email to") + } + return fmt.Errorf("no email to") } c.Now = time.Now().In(l) diff --git a/version.go b/version.go index 90b5c47..e961e7e 100644 --- a/version.go +++ b/version.go @@ -1,6 +1,6 @@ // Code generated by version.sh (@generated) DO NOT EDIT. package main -var githash = "a5b2d51" -var buildstamp = "2022-06-19_04:26:58" -var commits = "47" -var version = "a5b2d51-b47 - 2022-06-19_04:26:58" +var githash = "f2509f0" +var buildstamp = "2022-06-19_04:31:26" +var commits = "48" +var version = "f2509f0-b48 - 2022-06-19_04:31:26"