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,16 +243,21 @@ int fixsmb(char* sub)
else if(smb_undelete)
msg.hdr.attr&=~MSG_DELETE;
/* Create hash record */
if(msg.hdr.attr&MSG_DELETE)
text=NULL;
else
text=smb_getmsgtxt(&smb,&msg,GETMSGTXT_BODY_ONLY);
i=smb_hashmsg(&smb,&msg,(uchar*)text,TRUE /* update */);
if(i!=SMB_SUCCESS)
printf("!ERROR %d hashing message\n", i);
if(text!=NULL)
free(text);
if(renumber)
msg.hdr.number=n+1;
if(renumber || msg.hdr.number <= last_msg) {
/* Create hash record */
if(msg.hdr.attr&MSG_DELETE)
text=NULL;
else
text=smb_getmsgtxt(&smb,&msg,GETMSGTXT_BODY_ONLY);
i=smb_hashmsg(&smb,&msg,(uchar*)text,TRUE /* update */);
if(i!=SMB_SUCCESS)
printf("!ERROR %d hashing message\n", i);
if(text!=NULL)
free(text);
}
/* Index the header */
if(dupe_msgnum)
......@@ -263,8 +268,6 @@ int fixsmb(char* sub)
printf("Not indexing invalid message number (0)!\n");
else {
msg.idx_offset=n;
if(renumber)
msg.hdr.number=n+1;
if(msg.hdr.number > highest)
highest = msg.hdr.number;
if(msg.hdr.netattr&MSG_INTRANSIT) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment