diff options
author | Runxi Yu <me@runxiyu.org> | 2025-01-13 17:56:20 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-01-13 17:56:20 +0800 |
commit | 7d8ec380749cdd90a6e8c07529574007a527e9ec (patch) | |
tree | 6c3cae1a0c6dce6f846d7d063dfe9f0e22e2ae72 /serve_imap.go | |
parent | serve_mx stuff rename (diff) | |
download | maild-7d8ec380749cdd90a6e8c07529574007a527e9ec.tar.gz maild-7d8ec380749cdd90a6e8c07529574007a527e9ec.tar.zst maild-7d8ec380749cdd90a6e8c07529574007a527e9ec.zip |
Actually I'll do it manually instead of using go-imap
Diffstat (limited to 'serve_imap.go')
-rw-r--r-- | serve_imap.go | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/serve_imap.go b/serve_imap.go deleted file mode 100644 index 5337570..0000000 --- a/serve_imap.go +++ /dev/null @@ -1,39 +0,0 @@ -package main - -import ( - "crypto/tls" - - "github.com/emersion/go-imap/v2" - "github.com/emersion/go-imap/v2/imapserver" - "go.lindenii.runxiyu.org/lindenii-common/clog" -) - -func serve_imap() { - var tls_config *tls.Config - var imap_net, imap_addr string - config_consistent_run(func() { - tls_config = config._tls_config - imap_net = config.IMAP.Net - imap_addr = config.IMAP.Addr - }) - listener, err := tls.Listen(imap_net, imap_addr, tls_config) - if err != nil { - clog.Fatal(1, "IMAP: Cannot listen TLS: "+err.Error()) - } - clog.Info("IMAP: Listening via " + imap_net + " on " + imap_addr) - - server := imapserver.New(&imapserver.Options{ - NewSession: func(conn *imapserver.Conn) (imapserver.Session, *imapserver.GreetingData, error) { - return nil, nil, nil - }, - Caps: imap.CapSet{ - imap.CapIMAP4rev1: {}, - imap.CapIMAP4rev2: {}, - }, - DebugWriter: nil, // TODO - }) - err = server.Serve(listener) - if err != nil { - clog.Fatal(1, "IMAP: Failed serving: "+err.Error()) - } -} |