How to create a folder using IMAPLib?

Chris Angelico rosuav at gmail.com
Wed Nov 18 15:35:36 EST 2015


On Thu, Nov 19, 2015 at 7:01 AM, Anthony Papillion
<anthony at cajuntechie.org> wrote:
> I'm writing a program to help migrate mail from one host to another
> with a few special circumstances. I'm able to get a list off of the
> source IMAP server using the .list() command but I'm not quite sure
> how to create a folder on the target machine.
>
> Does anyone know how to create a folder using IMAPlib?

They're called "mailboxes", which I'll admit is not the most obvious
name, but imaplib is following the IMAP spec here. You can create them
with .create() and delete them with .delete().

ChrisA



More information about the Python-list mailing list