This is a quick step-by-step guide to updating the IMAP path prefix in Mac Mail (on macOS High Sierra), to correctly route your mail program to show all folders.
How to update the IMAP path prefix in Mac Mail
Open Mac Mail
Firstly, you'll need to open Mac Mail by clicking on the Mail icon, in your dock.
Choose 'Mail > Preferences'
Once Mac Mail has opened, choose 'Mail' from the main menu, then from the drop down menu choose 'Preferences'.
You will be presented with dialog box. Please click on the option labelled 'Accounts', and choose the relevant mailbox from the accounts listed in the left hand column.
Choose 'Server Settings'
Then click on the tab labelled 'Server Settings'.
Choose 'Advanced IMAP Settings'
Once you are on the 'Server Settings' pane, locate the button labelled 'Advanced IMAP Settings' and click on it.
Edit 'IMAP Path Prefix'
In the field labelled 'IMAP Path Prefix', enter "/".
Save Your Changes
When you have made these changes, close the dialog box. If you are prompted to save your changes, click on the 'Save' button. Your mail setup is complete. You may need to restart your mail client for the new settings to take effect. Once completed, you should be able to see all files that were present on the old mail system.