Rebuilding mailboxes
Since installing Big Sur, the search function in Mail has become completely unreliable, with large slabs of messages missing from the search. The messages are still available if you scroll down through thousands of messages to look for them, it's just that only some of them appear in searches. It's quite annoying. I've done a lot of research and it seems to be a common problem, and the only thing that's worked for me (with my icloud mail account) is to rebuild the mailbox.
The problem is that (as I understand it) when you tell Mail to rebuild a mailbox, it deletes all the mail on your computer from that account, and rebuilds the mailbox by downloading the messages from the mail server. That was fine with iCloud mail, because all my iCloud messages were on the iCloud mail server. But I have other mail accounts where the server does not preserve all the messages, going back maybe 15 - 20 years. So if the messages are deleted off my computer, they will not all be downloadable from the account's mail server.
I know that the messages are probably available on old Time Machine backups, but it would be incredibly messy and difficult to rebuild a mailbox that way - whenever I have investigated the underlying mail folders in the library, there seem to be many dozens of folders for each account with random numbers for names, it's completely incomprehensible to me.
So my questions are - (1) if I rebuild a mailbox, will it delete all the mail stored on my MBP for that account, and (2) how do I use a time machine or other backup to get messages into the rebuilt mailbox that aren't downloadable from the server?
Thanks
MacBook Pro 15″, macOS 11.2