diff options
author | Simon Ser <contact@emersion.fr> | 2020-01-20 12:00:04 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-01-20 12:00:04 +0100 |
commit | db328bf7c374ed7b079d9d8984cb25165605c28e (patch) | |
tree | 8e5605d354abff16a86f9928a4461acc31c9327e /cmd | |
parent | d5124c964533feff4490873607b1ef77b1e549c7 (diff) | |
download | alps-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')
-rw-r--r-- | cmd/koushin/main.go | 8 |
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 { |