From 54d085f7f3f0a8f6da83cc599c19c593b1412dc3 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 8 Mar 2021 17:01:23 +0100 Subject: [PATCH 1/4] (Patch by Florian Le Minioux) Fix HTTP 500 when missing some folders --- themes/alps/util.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/themes/alps/util.html b/themes/alps/util.html index 9cdfd86..b0022ec 100644 --- a/themes/alps/util.html +++ b/themes/alps/util.html @@ -32,12 +32,12 @@ ">Compose mail {{ with .CategorizedMailboxes }} - {{ with .Common.Inbox }}{{ template "mbox-link" . }}{{ end }} - {{ with .Common.Drafts }}{{ template "mbox-link" . }}{{ end }} - {{ with .Common.Sent }}{{ template "mbox-link" . }}{{ end }} - {{ with .Common.Junk }}{{ template "mbox-link" . }}{{ end }} - {{ with .Common.Trash }}{{ template "mbox-link" . }}{{ end }} - {{ with .Common.Archive }}{{ template "mbox-link" . }}{{ end }} + {{ if .Common.Inbox.Info }}{{ with .Common.Inbox }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Drafts.Info }}{{ with .Common.Drafts }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Sent.Info }}{{ with .Common.Sent }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Junk.Info }}{{ with .Common.Junk }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Trash.Info }}{{ with .Common.Trash }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Archive.Info }}{{ with .Common.Archive }}{{ template "mbox-link" . }}{{ end }}{{ end }} {{ if .Additional }}
{{ range .Additional }} -- 2.43.4 From bc40bed6e561c034654d757f2514e9e24be388ea Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 8 Mar 2021 17:22:46 +0100 Subject: [PATCH 2/4] Implement "skip TLS verification" as command line argument --- cmd/alps/main.go | 1 + imap.go | 3 ++- server.go | 11 ++++++----- smtp.go | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cmd/alps/main.go b/cmd/alps/main.go index 5a00957..b38ac59 100644 --- a/cmd/alps/main.go +++ b/cmd/alps/main.go @@ -34,6 +34,7 @@ func main() { flag.StringVar(&options.Theme, "theme", "", "default theme") flag.StringVar(&addr, "addr", ":1323", "listening address") flag.BoolVar(&options.Debug, "debug", false, "enable debug logs") + flag.BoolVar(&options.SkipTlsVerification, "skiptlsverification", false, "skip TLS hostname verification") flag.StringVar(&loginKey, "login-key", "", "Fernet key for login persistence") flag.Usage = func() { diff --git a/imap.go b/imap.go index 7554331..978363a 100644 --- a/imap.go +++ b/imap.go @@ -1,6 +1,7 @@ package alps import ( + "crypto/tls" "fmt" "github.com/emersion/go-imap" @@ -16,7 +17,7 @@ func (s *Server) dialIMAP() (*imapclient.Client, error) { var c *imapclient.Client var err error if s.imap.tls { - c, err = imapclient.DialTLS(s.imap.host, nil) + c, err = imapclient.DialTLS(s.imap.host, &tls.Config{InsecureSkipVerify: s.Options.SkipTlsVerification}) if err != nil { return nil, fmt.Errorf("failed to connect to IMAPS server: %v", err) } diff --git a/server.go b/server.go index 17018c1..b005ebc 100644 --- a/server.go +++ b/server.go @@ -365,11 +365,12 @@ func handleUnauthenticated(next echo.HandlerFunc, ctx *Context) error { } type Options struct { - Upstreams []string - Theme string - ThemesPath string - Debug bool - LoginKey *fernet.Key + Upstreams []string + Theme string + ThemesPath string + Debug bool + SkipTlsVerification bool + LoginKey *fernet.Key } // New creates a new server. diff --git a/smtp.go b/smtp.go index 5e178f2..4c720e2 100644 --- a/smtp.go +++ b/smtp.go @@ -1,6 +1,7 @@ package alps import ( + "crypto/tls" "fmt" "github.com/emersion/go-smtp" @@ -14,7 +15,7 @@ func (s *Server) dialSMTP() (*smtp.Client, error) { var c *smtp.Client var err error if s.smtp.tls { - c, err = smtp.DialTLS(s.smtp.host, nil) + c, err = smtp.DialTLS(s.smtp.host, &tls.Config{InsecureSkipVerify: s.Options.SkipTlsVerification}) if err != nil { return nil, fmt.Errorf("failed to connect to SMTPS server: %v", err) } -- 2.43.4 From e045227527de36cdbb954e00a4cf8de041a25828 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 8 Mar 2021 17:24:22 +0100 Subject: [PATCH 3/4] Remove 10rem height on select --- themes/alps/assets/style.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/alps/assets/style.css b/themes/alps/assets/style.css index d652f66..50453c9 100644 --- a/themes/alps/assets/style.css +++ b/themes/alps/assets/style.css @@ -667,9 +667,11 @@ main table tfoot { float: left; } +/* .action-group select { height: 10rem; } +*/ .actions-message, .actions-contacts { -- 2.43.4 From bf9ccc6ed17e8b50a230e9f5809d820e9de8562f Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 6 Dec 2022 16:12:27 +0100 Subject: [PATCH 4/4] Fix util.html template --- themes/alps/util.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/themes/alps/util.html b/themes/alps/util.html index b0022ec..f425dfe 100644 --- a/themes/alps/util.html +++ b/themes/alps/util.html @@ -32,12 +32,12 @@ ">Compose mail {{ with .CategorizedMailboxes }} - {{ if .Common.Inbox.Info }}{{ with .Common.Inbox }}{{ template "mbox-link" . }}{{ end }}{{ end }} - {{ if .Common.Drafts.Info }}{{ with .Common.Drafts }}{{ template "mbox-link" . }}{{ end }}{{ end }} - {{ if .Common.Sent.Info }}{{ with .Common.Sent }}{{ template "mbox-link" . }}{{ end }}{{ end }} - {{ if .Common.Junk.Info }}{{ with .Common.Junk }}{{ template "mbox-link" . }}{{ end }}{{ end }} - {{ if .Common.Trash.Info }}{{ with .Common.Trash }}{{ template "mbox-link" . }}{{ end }}{{ end }} - {{ if .Common.Archive.Info }}{{ with .Common.Archive }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Inbox }}{{ with .Common.Inbox }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Drafts }}{{ with .Common.Drafts }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Sent }}{{ with .Common.Sent }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Junk }}{{ with .Common.Junk }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Trash }}{{ with .Common.Trash }}{{ template "mbox-link" . }}{{ end }}{{ end }} + {{ if .Common.Archive }}{{ with .Common.Archive }}{{ template "mbox-link" . }}{{ end }}{{ end }} {{ if .Additional }}
{{ range .Additional }} -- 2.43.4