mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 09:54:40 +03:00
listen/bind in deterministic order for consistent error messages, and warn if quickstart cannot find public ip's
without public ip's, the generated mox config will try to listen on 0.0.0.0 and ::, but because there is already a listener for 127.0.0.1:80 (and possibly others), a bind for 0.0.0.0:80 will fail. explicit public ip's are needed. the public http listener is useful for ACME validation over http. for issue #52
This commit is contained in:
@ -57,11 +57,12 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
"golang.org/x/exp/maps"
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
|
||||
"github.com/mjl-/bstore"
|
||||
|
||||
"github.com/mjl-/mox/config"
|
||||
@ -307,7 +308,11 @@ type msgseq uint32
|
||||
|
||||
// Listen initializes all imap listeners for the configuration, and stores them for Serve to start them.
|
||||
func Listen() {
|
||||
for name, listener := range mox.Conf.Static.Listeners {
|
||||
names := maps.Keys(mox.Conf.Static.Listeners)
|
||||
sort.Strings(names)
|
||||
for _, name := range names {
|
||||
listener := mox.Conf.Static.Listeners[name]
|
||||
|
||||
var tlsConfig *tls.Config
|
||||
if listener.TLS != nil {
|
||||
tlsConfig = listener.TLS.Config
|
||||
|
Reference in New Issue
Block a user