I had a problem where none of my iCloud Mail folders were visible in Mail on my iMac. I did some web research, and found several suggestions to delete files and force Mail to rebuild its databases. But I found one simple, fast solution that worked perfectly:

Go to System Preferences > iCloud
Uncheck Mail in the list
Close System Preferences
Go to System Preferences > iCloud
Check Mail in the list
Close System Preferences

It's possible that there's no need to close System Preferences that extra time.

"Design is not just what it looks like and feels like. Design is how it works."
Steve Jobs