Finding and fixing an invalid header

On 64-bit Thunderbird 91.10.0 on macOS Monterey 12.4, I am trying to move about 2200 emails from one mailbox to another and one particular email interrupts the process with the error “Message contains invalid header”. How can I find out which email is causing this interruption and how can I fix it?

I would think, process of elimination to find it.

Try with the first 1100, if that works, try the next 550 and so on.

Sorry, I don’t know how to fix it.

Okay I’ve solved the second problem (fixing the header) by right-clicking on the folder and choosing Properties > General Information > Repair Folder. That alone made the move “just work”.

But doing the process of elimination as suggested would be more difficult than it seams, because 1. I am operating on a subset of the email in this folder, and 2. as it is, I can see no column that enumerates emails except for “Order Received”.

Are there any extensions that would add a column that counts all of the emails sequentially for an entire folder, with and without a filter applied? Could such a column be accomplished in code somehow?

For the Thread pane, you can add a Total column, which displays the total number of messages in a thread.

For the Folder pane, you can enable View > Layout > Folder Pane Columns, select Total, and show the total number of messages in a folder.

Thanks but for example, if I enable the Total column in the Thread pane in a folder with no threaded emails, they all show up with “1” in the Total column. This would not help me find email number n.

Is there a way for a user to code a function of their own design into a column? Come to think of it, I am quite sure there is. See the Sender Frequency add-on for an example.

So the question is, how do I write my own?

Got me. I have no coding knowledge, and would probably use Quick Search or some other built-in search feature.