aboutsummaryrefslogtreecommitdiff
path: root/serve_mx.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-01-13 16:33:50 +0800
committerRunxi Yu <me@runxiyu.org>2025-01-13 16:33:50 +0800
commitb27e7a73337659aca8ed1aadd4b907048b1f598c (patch)
treeaee98e8ef63b51724e22eeceb62d70f4c670e80c /serve_mx.go
parentRefactor mx stuff (diff)
downloadmaild-b27e7a73337659aca8ed1aadd4b907048b1f598c.tar.gz
maild-b27e7a73337659aca8ed1aadd4b907048b1f598c.tar.zst
maild-b27e7a73337659aca8ed1aadd4b907048b1f598c.zip
Listen to IMAP
Diffstat (limited to '')
-rw-r--r--serve_mx.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/serve_mx.go b/serve_mx.go
index f3c1527..32710be 100644
--- a/serve_mx.go
+++ b/serve_mx.go
@@ -232,12 +232,17 @@ func handle_mx_recv_conn(ctx context.Context, net_conn net.Conn) error {
}
func serve_mx() {
- listener, err := net.Listen(config.MX.Net, config.MX.Addr)
+ var mx_net, mx_addr string
+ config_consistent_run(func(){
+ mx_net = config.MX.Net
+ mx_addr = config.MX.Addr
+ })
+ listener, err := net.Listen(mx_net, mx_addr)
if err != nil {
clog.Fatal(1, "MX: Cannot listen: "+err.Error())
}
defer listener.Close()
- clog.Info("MX: Listening via " + config.MX.Net + " on " + config.MX.Addr)
+ clog.Info("MX: Listening via " + mx_net + " on " + mx_addr)
for {
conn, err := listener.Accept()