I need to select the 'Sent' and 'Spam' folders in Gmail, but I have an account that does not work. I've found out later that the folders are in non-English language, but it doesn't seem to represent the unicode characters of those language either. Does anybody know how to find out which one is the 'Sent' or 'Spam' folder of a Gmail account?
You should use XLIST command, Google and Apple developed a special IMAP command XLIST to address this issue.
IMAP XLIST command returns a list of folders and their well-know flags (\Inbox, \Drafts, \Trash, \Sent, \Spam).