aboutsummaryrefslogtreecommitdiff
path: root/cmd/koushin/main.go
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-01-20 12:00:04 +0100
committerSimon Ser <contact@emersion.fr>2020-01-20 12:00:04 +0100
commitdb328bf7c374ed7b079d9d8984cb25165605c28e (patch)
tree8e5605d354abff16a86f9928a4461acc31c9327e /cmd/koushin/main.go
parentd5124c964533feff4490873607b1ef77b1e549c7 (diff)
downloadalps-db328bf7c374ed7b079d9d8984cb25165605c28e.tar.gz
alps-db328bf7c374ed7b079d9d8984cb25165605c28e.zip
Generalize upstream server URLs
koushin now takes a list of upstream URLs instead of an IMAP and SMTP URL. This allows to specify upstream server URLs for plugins. In the future, this will allow for auto-discovering upstream servers based on a single domain name. References: https://todo.sr.ht/~sircmpwn/koushin/49
Diffstat (limited to 'cmd/koushin/main.go')
-rw-r--r--cmd/koushin/main.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/cmd/koushin/main.go b/cmd/koushin/main.go
index 472cd4a..d22b404 100644
--- a/cmd/koushin/main.go
+++ b/cmd/koushin/main.go
@@ -22,20 +22,18 @@ func main() {
flag.StringVar(&addr, "addr", ":1323", "listening address")
flag.Usage = func() {
- fmt.Fprintf(flag.CommandLine.Output(), "usage: koushin [options...] <IMAP URL> [SMTP URL]\n")
+ fmt.Fprintf(flag.CommandLine.Output(), "usage: koushin [options...] <upstream server...>\n")
flag.PrintDefaults()
}
flag.Parse()
- if flag.NArg() < 1 || flag.NArg() > 2 {
+ options.Upstreams = flag.Args()
+ if len(options.Upstreams) == 0 {
flag.Usage()
return
}
- options.IMAPURL = flag.Arg(0)
- options.SMTPURL = flag.Arg(1)
-
e := echo.New()
e.HideBanner = true
if l, ok := e.Logger.(*log.Logger); ok {