From 945da2c75c3d5b2ef04fc90a296d7468ca9d23db Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Fri, 1 Dec 2023 15:03:01 +1300 Subject: [PATCH] Chore: Clearer log messages for bound SMTP & HTTP addresses See #211 --- server/server.go | 6 ++++-- server/smtpd/smtp.go | 2 +- server/smtpd/smtpd.go | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/server.go b/server/server.go index 866dc4b..46d9085 100644 --- a/server/server.go +++ b/server/server.go @@ -90,11 +90,13 @@ func Listen() { // Mark the application here as ready isReady.Store(true) + logger.Log().Infof("[http] starting on %s", config.HTTPListen) + if config.UITLSCert != "" && config.UITLSKey != "" { - logger.Log().Infof("[http] starting secure server on https://%s%s", logger.CleanHTTPIP(config.HTTPListen), config.Webroot) + logger.Log().Infof("[http] accessible via https://%s%s", logger.CleanHTTPIP(config.HTTPListen), config.Webroot) logger.Log().Fatal(http.ListenAndServeTLS(config.HTTPListen, config.UITLSCert, config.UITLSKey, nil)) } else { - logger.Log().Infof("[http] starting server on http://%s%s", logger.CleanHTTPIP(config.HTTPListen), config.Webroot) + logger.Log().Infof("[http] accessible via http://%s%s", logger.CleanHTTPIP(config.HTTPListen), config.Webroot) logger.Log().Fatal(http.ListenAndServe(config.HTTPListen, nil)) } } diff --git a/server/smtpd/smtp.go b/server/smtpd/smtp.go index eae14a5..45d741d 100644 --- a/server/smtpd/smtp.go +++ b/server/smtpd/smtp.go @@ -127,7 +127,7 @@ func LoginAuth(username, password string) smtp.Auth { return &loginAuth{username, password} } -func (a *loginAuth) Start(server *smtp.ServerInfo) (string, []byte, error) { +func (a *loginAuth) Start(_ *smtp.ServerInfo) (string, []byte, error) { return "LOGIN", []byte{}, nil } diff --git a/server/smtpd/smtpd.go b/server/smtpd/smtpd.go index d0e310e..21b9a0d 100644 --- a/server/smtpd/smtpd.go +++ b/server/smtpd/smtpd.go @@ -163,7 +163,7 @@ func Listen() error { } } - logger.Log().Infof("[smtpd] starting on %s", logger.CleanIP(config.SMTPListen)) + logger.Log().Infof("[smtpd] starting on %s", config.SMTPListen) return listenAndServe(config.SMTPListen, mailHandler, authHandler) }