aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/main.go b/main.go
index bbea985..f90cc50 100644
--- a/main.go
+++ b/main.go
@@ -2,9 +2,12 @@ package main
import (
"flag"
+ "fmt"
+ "net/url"
"os"
"github.com/Necoro/feed2imap-go/internal/config"
+ "github.com/Necoro/feed2imap-go/internal/imap"
"github.com/Necoro/feed2imap-go/internal/log"
"github.com/Necoro/feed2imap-go/internal/parse"
)
@@ -26,6 +29,18 @@ func run() error {
parse.Parse(cfg.Feeds)
+ imapUrl, err := url.Parse(cfg.GlobalConfig["target"].(string))
+ if err != nil {
+ return fmt.Errorf("parsing 'target': %w", err)
+ }
+
+ c, err := imap.Connect(imapUrl)
+ if err != nil {
+ return err
+ }
+
+ defer c.Disconnect()
+
return nil
}