From db328bf7c374ed7b079d9d8984cb25165605c28e Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 20 Jan 2020 12:00:04 +0100 Subject: 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 --- cmd/koushin/main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cmd') 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...] [SMTP URL]\n") + fmt.Fprintf(flag.CommandLine.Output(), "usage: koushin [options...] \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 { -- cgit v1.2.3