From a29a3efc12c4dbceccca593bddfe2daf5bc7d43b Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 18 Apr 2018 06:00:39 +0000
Subject: [PATCH] Use a different source for the message number in
 smb_getmsghdr() failure error log message as the header is zeroed in this
 function and thus the message number previously read from the index, lost
 (zeroed) and useless.

---
 src/sbbs3/mailsrvr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sbbs3/mailsrvr.c b/src/sbbs3/mailsrvr.c
index b8257645a8..8d69baeb6b 100644
--- a/src/sbbs3/mailsrvr.c
+++ b/src/sbbs3/mailsrvr.c
@@ -1303,7 +1303,7 @@ static void pop3_thread(void* arg)
 			smb_unlockmsghdr(&smb,&msg);
 			if(i!=0) {
 				lprintf(LOG_ERR,"%04d !POP3 <%s> ERROR %d (%s) line %u, msg #%u"
-					,socket, user.alias, i, smb.last_error, __LINE__, msg.hdr.number);
+					,socket, user.alias, i, smb.last_error, __LINE__, mail[l].number);
 				break;
 			}
 			bytes+=smb_getmsgtxtlen(&msg);
-- 
GitLab