A webmail client. Forked from https://git.sr.ht/~migadu/alps
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

45 righe
873 B

  1. package main
  2. import (
  3. "flag"
  4. "fmt"
  5. "git.sr.ht/~emersion/koushin"
  6. "github.com/labstack/echo/v4"
  7. "github.com/labstack/echo/v4/middleware"
  8. "github.com/labstack/gommon/log"
  9. _ "git.sr.ht/~emersion/koushin/plugins/base"
  10. )
  11. func main() {
  12. var options koushin.Options
  13. flag.StringVar(&options.Theme, "theme", "", "default theme")
  14. flag.Usage = func() {
  15. fmt.Fprintf(flag.CommandLine.Output(), "usage: koushin [options...] <IMAP URL> [SMTP URL]\n")
  16. flag.PrintDefaults()
  17. }
  18. flag.Parse()
  19. if flag.NArg() < 1 || flag.NArg() > 2 {
  20. flag.Usage()
  21. return
  22. }
  23. options.IMAPURL = flag.Arg(0)
  24. options.SMTPURL = flag.Arg(1)
  25. e := echo.New()
  26. if l, ok := e.Logger.(*log.Logger); ok {
  27. l.SetHeader("${time_rfc3339} ${level}")
  28. }
  29. _, err := koushin.New(e, &options)
  30. if err != nil {
  31. e.Logger.Fatal(err)
  32. }
  33. e.Use(middleware.Recover())
  34. e.Logger.Fatal(e.Start(":1323"))
  35. }