aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/config.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pkg/config/config.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/config/config.go b/pkg/config/config.go
index 0d2c944..aaf6701 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -23,6 +23,7 @@ type GlobalOptions struct {
Target Url `yaml:"target"`
Parts []string `yaml:"parts"`
MaxFailures int `yaml:"max-failures"`
+ MaxConns int `yaml:"max-imap-connections"`
AutoTarget bool `yaml:"auto-target"`
HtmlTemplate string `yaml:"html-template"`
TextTemplate string `yaml:"text-template"`
@@ -32,6 +33,7 @@ var DefaultGlobalOptions = GlobalOptions{
Cache: "feed.cache",
Timeout: 30,
MaxFailures: 10,
+ MaxConns: 5,
DefaultEmail: username() + "@" + Hostname(),
Target: Url{},
Parts: []string{"text", "html"},
@@ -103,6 +105,10 @@ func (cfg *Config) Validate() error {
}
}
+ if cfg.MaxConns < 1 {
+ return fmt.Errorf("max-imap-connections is '%d', but must be at least 1.", cfg.MaxConns)
+ }
+
return nil
}