>folderfilter = lambda foldername: foldername not in ['[Gmail]/Trash'] ? Thanks a lot, this seems to fix it. Also, in gmail, Trash appears in [Imap]/Trash, so we are still not losing it.