Uninstall each third party running applications from the computer and see this method .
Take back of all mails in V5 folder : Method to copy mails in V5 folder .Click on Go on top menu bar , hold option key click on > library > select mail folder > right click on mail folder 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 V5 folder .
For Mac OS High Sierra - the folder will be V5 , For Mac OS Sierra - the folder will be V4 , For El Capitan - the folder will be V3 , and for OSX Yosemite the folder will be V2 .
Go to the corrupted IMAP account > open system preferences > click on internet accounts > select the account that has to be deleted & click on minus sign .
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 .
Also check in new user account How to test an issue in another user account on your Mac - Apple Support and configure mails Set up Mail with email accounts - Apple Support