1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

SMTP, logging changes

- smtpd/handler uses ParseEmailAddress() when opening mailbox and
  checking domainNoStore
- Added host info to logging for both SMTP and POP3, closes #16
This commit is contained in:
James Hillyerd
2013-11-05 15:18:19 -08:00
parent 962e995268
commit 6b606ebb9b
2 changed files with 19 additions and 12 deletions

View File

@@ -611,21 +611,21 @@ func (ses *Session) ooSeq(cmd string) {
// Session specific logging methods
func (ses *Session) logTrace(msg string, args ...interface{}) {
log.LogTrace("POP3<%v> %v", ses.id, fmt.Sprintf(msg, args...))
log.LogTrace("POP3[%v]<%v> %v", ses.remoteHost, ses.id, fmt.Sprintf(msg, args...))
}
func (ses *Session) logInfo(msg string, args ...interface{}) {
log.LogInfo("POP3<%v> %v", ses.id, fmt.Sprintf(msg, args...))
log.LogInfo("POP3[%v]<%v> %v", ses.remoteHost, ses.id, fmt.Sprintf(msg, args...))
}
func (ses *Session) logWarn(msg string, args ...interface{}) {
// Update metrics
//expWarnsTotal.Add(1)
log.LogWarn("POP3<%v> %v", ses.id, fmt.Sprintf(msg, args...))
log.LogWarn("POP3[%v]<%v> %v", ses.remoteHost, ses.id, fmt.Sprintf(msg, args...))
}
func (ses *Session) logError(msg string, args ...interface{}) {
// Update metrics
//expErrorsTotal.Add(1)
log.LogError("POP3<%v> %v", ses.id, fmt.Sprintf(msg, args...))
log.LogError("POP3[%v]<%v> %v", ses.remoteHost, ses.id, fmt.Sprintf(msg, args...))
}