From 64b413336c4f73936473cfe33564736c325a57f6 Mon Sep 17 00:00:00 2001 From: Ricardo Signes Date: Thu, 10 Aug 2023 15:58:04 -0400 Subject: [PATCH] imap.c: when logging client ID, log userid if authenticated --- imap/imapd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imap/imapd.c b/imap/imapd.c index 161aece4ae..09ca480201 100644 --- a/imap/imapd.c +++ b/imap/imapd.c @@ -3423,7 +3423,10 @@ static void cmd_id(char *tag) buf_printf(&logbuf, "\"%s\"", val); } - syslog(LOG_INFO, "client id sessionid=<%s>:%s", session_id(), buf_cstring(&logbuf)); + syslog(LOG_INFO, "client id sessionid=<%s> userid=<%s>:%s", + session_id(), + imapd_userid ? imapd_userid : "", + buf_cstring(&logbuf)); buf_free(&logbuf); }