diff options
Diffstat (limited to '')
-rw-r--r-- | internal/config/config.go | 9 | ||||
-rw-r--r-- | internal/imap/imap.go | 3 | ||||
-rw-r--r-- | internal/yaml/yaml.go | 5 |
3 files changed, 15 insertions, 2 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index a37cef1..409cbdf 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,6 +1,7 @@ package config import ( + "fmt" "os" "os/user" "runtime" @@ -33,6 +34,14 @@ type Options struct { InclImages *bool `yaml:"include-images"` } +func (c *Config) Validate() error { + if c.Target == "" { + return fmt.Errorf("No target set!") + } + + return nil +} + func (c *Config) WithPartText() bool { for _, part := range c.Parts { if part == "text" { diff --git a/internal/imap/imap.go b/internal/imap/imap.go index f2a9082..2fd7580 100644 --- a/internal/imap/imap.go +++ b/internal/imap/imap.go @@ -99,8 +99,9 @@ func Connect(url *url.URL) (*Client, error) { } log.Print("Connected to ", url.Host, " (STARTTLS)") + } else { + log.Print("Connected to ", url.Host, " (Plain)") } - log.Print("Connected to ", url.Host, " (Plain)") } pwd, _ := url.User.Password() diff --git a/internal/yaml/yaml.go b/internal/yaml/yaml.go index 3317f5d..207adab 100644 --- a/internal/yaml/yaml.go +++ b/internal/yaml/yaml.go @@ -128,5 +128,8 @@ func Load(path string) (C.Config, F.Feeds, error) { return C.Config{}, nil, fmt.Errorf("while parsing: %w", err) } - return C.Config{GlobalConfig: parsedCfg.GlobalConfig}, feeds, nil + return C.Config{ + GlobalOptions: parsedCfg.GlobalOptions, + GlobalConfig: parsedCfg.GlobalConfig, + }, feeds, nil } |