From b27e7a73337659aca8ed1aadd4b907048b1f598c Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 13 Jan 2025 16:33:50 +0800 Subject: Listen to IMAP --- serve_mx.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'serve_mx.go') 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() -- cgit v1.2.3