I am trying to build a simple email client with python and IMAPClient. The problem is that the folder names aren't uniform for all servers.
If i mark an e-mail as spam, it has to be moved to the spam/junk folder from the inbox folder (?) .. but i am unable to do that because i don't know what the folder name would be (Spam or INBOX.junk or [Gmail]/Spam )
How do other email clients work with varying folder names ?
I believe that for common EMail providers they have a mapping as to what that provider uses by default (gmail, hotmail, exchange etc.).
Another way of doing it is to let the user decide first time, persist the setting for that account and not ask again.
Mixed approach would be to try and detect all common variations and use the first valid one you encounter. If there are more then one simply allow user to choose.
Identifying IMAP mail folders (spam,sent...), folder names vary with servers