From bb3485a9c4e2c36a07aaf512d174aa8c4b7d36c7 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Mon, 11 Nov 2024 18:54:43 -0800
Subject: [PATCH] Include the size of the message headers in the POP3 STAT
 response too

I suppose if we only had messages with no body text, this value could be 0
(not accounting for any headers) and thus throw a client off.

So consider this as part of the fix for issue #822.
---
 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 b37f4e746f..834d3c65e9 100644
--- a/src/sbbs3/mailsrvr.c
+++ b/src/sbbs3/mailsrvr.c
@@ -1415,7 +1415,7 @@ static bool pop3_client_thread(pop3_t* pop3)
 					,socket, client.protocol, user.alias, i, smb.last_error, __LINE__, msg.idx.number);
 				break;
 			}
-			bytes+=smb_getmsgtxtlen(&msg);
+			bytes+=msg.hdr.length + smb_getmsgtxtlen(&msg);
 			smb_freemsgmem(&msg);
 		}
 
-- 
GitLab