aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-01-13 17:56:20 +0800
committerRunxi Yu <me@runxiyu.org>2025-01-13 17:56:20 +0800
commit7d8ec380749cdd90a6e8c07529574007a527e9ec (patch)
tree6c3cae1a0c6dce6f846d7d063dfe9f0e22e2ae72
parentserve_mx stuff rename (diff)
downloadmaild-7d8ec380749cdd90a6e8c07529574007a527e9ec.tar.gz
maild-7d8ec380749cdd90a6e8c07529574007a527e9ec.tar.zst
maild-7d8ec380749cdd90a6e8c07529574007a527e9ec.zip
Actually I'll do it manually instead of using go-imap
-rw-r--r--go.mod2
-rw-r--r--go.sum4
-rw-r--r--main.go1
-rw-r--r--serve_imap.go39
4 files changed, 0 insertions, 46 deletions
diff --git a/go.mod b/go.mod
index de766ee..2ff8d98 100644
--- a/go.mod
+++ b/go.mod
@@ -3,13 +3,11 @@ module go.lindenii.runxiyu.org/maild
go 1.23.4
require (
- github.com/emersion/go-imap/v2 v2.0.0-beta.4
github.com/jackc/pgx/v5 v5.7.2
go.lindenii.runxiyu.org/lindenii-common v0.0.0-20250113062520-2daa71bfa256
)
require (
- github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
diff --git a/go.sum b/go.sum
index d9cbdd6..2be52d7 100644
--- a/go.sum
+++ b/go.sum
@@ -1,10 +1,6 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/emersion/go-imap/v2 v2.0.0-beta.4 h1:BS7+kUVhe/jfuFWgn8li0AbCKBIDoNvqJWsRJppltcc=
-github.com/emersion/go-imap/v2 v2.0.0-beta.4/go.mod h1:BZTFHsS1hmgBkFlHqbxGLXk2hnRqTItUgwjSSCsYNAk=
-github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 h1:hH4PQfOndHDlpzYfLAAfl63E8Le6F2+EL/cdhlkyRJY=
-github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
diff --git a/main.go b/main.go
index d4b3696..51540f9 100644
--- a/main.go
+++ b/main.go
@@ -17,7 +17,6 @@ func main() {
clog.Fatal(1, "Error while loading configuration file: "+err.Error())
}
- go serve_imap()
go serve_mx()
deadlock := make(chan struct{})
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())
- }
-}