Skip to content
Snippets Groups Projects
Commit 1b8402a6 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Don't hash messages with invalid message numbers

It's better to have deleted messages without a hash than to hash invalid
message numbers.

This can be used to address a (renumbered?) message base that Kirkman
shared with me with "Invalid Message number" chksmb warnings from hash
entries with message numbers > than the base's last_msg.
parent f605e394
No related branches found
No related tags found
No related merge requests found
Pipeline #6119 passed
...@@ -243,6 +243,10 @@ int fixsmb(char* sub) ...@@ -243,6 +243,10 @@ int fixsmb(char* sub)
else if(smb_undelete) else if(smb_undelete)
msg.hdr.attr&=~MSG_DELETE; msg.hdr.attr&=~MSG_DELETE;
if(renumber)
msg.hdr.number=n+1;
if(renumber || msg.hdr.number <= last_msg) {
/* Create hash record */ /* Create hash record */
if(msg.hdr.attr&MSG_DELETE) if(msg.hdr.attr&MSG_DELETE)
text=NULL; text=NULL;
...@@ -253,6 +257,7 @@ int fixsmb(char* sub) ...@@ -253,6 +257,7 @@ int fixsmb(char* sub)
printf("!ERROR %d hashing message\n", i); printf("!ERROR %d hashing message\n", i);
if(text!=NULL) if(text!=NULL)
free(text); free(text);
}
/* Index the header */ /* Index the header */
if(dupe_msgnum) if(dupe_msgnum)
...@@ -263,8 +268,6 @@ int fixsmb(char* sub) ...@@ -263,8 +268,6 @@ int fixsmb(char* sub)
printf("Not indexing invalid message number (0)!\n"); printf("Not indexing invalid message number (0)!\n");
else { else {
msg.idx_offset=n; msg.idx_offset=n;
if(renumber)
msg.hdr.number=n+1;
if(msg.hdr.number > highest) if(msg.hdr.number > highest)
highest = msg.hdr.number; highest = msg.hdr.number;
if(msg.hdr.netattr&MSG_INTRANSIT) { if(msg.hdr.netattr&MSG_INTRANSIT) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment