Rebuilding the spotlight : How to rebuild the Spotlight index on your Mac - Apple Support
Could be applied and see if it works , or the best method I prefer is :
Take back of all mails in V4folder : Method for how to copy in V4 folder .
Click on go on top menu bar , hold option key click on > library > select mail folder > right click on mail there itself > click on copy mail > right click on extreme right hand side in column B , that is below persistence info.plist > click on paste item .
Entire mails are copied to V4 folder .
Go to the corrupted IMAP account , select it & click on minus sign it is deleted .
Configure new IMAP account , go to top menu bar ,file > import mail boxes > import data from > select apple mail > click on continue > select the back drop folder then choose new .
When new IMAP account is opened , a new folder with all mails will appear in the mail side bar .You can rename the folder .
Did you try to click on get mail icon the very basic step .
You can also run : https://www.etrecheck.com/
And post the results , it will help what could be reason of mail corruption , may be its due to some malware , anti - virus , cleaners , unwanted apps installed in the system .
Your personal information will not be shown , this tool has no side effects on your system .
Also : Malwarebytes | Malwarebytes Anti-Malware for Mac
Is used and a very compatible software to remove malware from Mac within moments , you can install it and scan the system .