1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-07-17 01:32:33 +02:00

Chore: Clearer log messages for bound SMTP & HTTP addresses

See #211
This commit is contained in:
Ralph Slooten
2023-12-01 15:03:01 +13:00
parent 2e9d5008c2
commit 945da2c75c
3 changed files with 6 additions and 4 deletions

View File

@ -90,11 +90,13 @@ func Listen() {
// Mark the application here as ready // Mark the application here as ready
isReady.Store(true) isReady.Store(true)
logger.Log().Infof("[http] starting on %s", config.HTTPListen)
if config.UITLSCert != "" && config.UITLSKey != "" { 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)) logger.Log().Fatal(http.ListenAndServeTLS(config.HTTPListen, config.UITLSCert, config.UITLSKey, nil))
} else { } 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)) logger.Log().Fatal(http.ListenAndServe(config.HTTPListen, nil))
} }
} }

View File

@ -127,7 +127,7 @@ func LoginAuth(username, password string) smtp.Auth {
return &loginAuth{username, password} 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 return "LOGIN", []byte{}, nil
} }

View File

@ -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) return listenAndServe(config.SMTPListen, mailHandler, authHandler)
} }