By default when using “listAllFolders” in Gmail using CFImap, some key folders like “Drafts” and “Sent Mail” do not show up.
To get the system folders you have to target the folder: "[Gmail]."
I 'm not sure the reason though it likely has something to do with the fact that Gmail works with "Labels" and not folders. The solution is to know what to target. To get the system folders you have to target the folder: "[Gmail]" as in the code sample below:
<cfsetting showdebugoutput = true enablecfoutputonly="false" />
<cfimap action="open" server="imap.gmail.com" secure="true"
username="#username#" password="#password#" connection="imap" >
<cfimap action="listallfolders" connection="imap"
recurse="true" name="temp" folder="[Gmail]" >
<cfimap action="close" connection="imap" />
+