Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Imap Version 0.1.1 preview

6 views
Skip to first unread message

Daniel Roesler

unread,
Jan 13, 2009, 3:44:59 PM1/13/09
to ImapGrab Mailing List
I've added Maildir support (with the -M or --maildir option) and added
support for nesting folders. So if you have [Gmail]/Starred, it will
create a [Gmail] folder and save Starred.mbox (or a maildir directory)
in [Gmail].

However, if the mailbox you want to download has a "/" (or os.sep in
python) in the name, imapgrab will create a directory for that as
well. I would have to go into the IMAP response for "List" (i.e. look
at HasChildren part) to fix this, but I don't plan on doing that for a
while (maybe in v0.9 to clean up before v1.0). Give me a good reason,
and I might do it earlier.

For Maildir nested folders, it will NOT create new/cur/tmp folders for
the higher folders (i.e. [Gmail] will not have new/cur/tmp folders).

I will upload this to the SVN later today.

Avast!
Daniel Roesler
dia...@gmail.com

imapgrab-0.1.1.py

My BSD

unread,
Jan 14, 2009, 10:36:58 AM1/14/09
to imap...@googlegroups.com
On Tue, 13 Jan 2009 14:44:59 -0600
"Daniel Roesler" <dia...@gmail.com> wrote:

> I've added Maildir support (with the -M or --maildir option) and added
> support for nesting folders. So if you have [Gmail]/Starred, it will
> create a [Gmail] folder and save Starred.mbox (or a maildir directory)
> in [Gmail].
>

Great, that was fast!

Then, for Maildir the layout would be something like this?:

/ [Gmail]Starred/{cur,new,tmp}
/ [Gmail]OtherFolder/{cur,new,tmp}


> However, if the mailbox you want to download has a "/" (or os.sep in
> python) in the name, imapgrab will create a directory for that as
> well. I would have to go into the IMAP response for "List" (i.e. look
> at HasChildren part) to fix this, but I don't plan on doing that for a
> while (maybe in v0.9 to clean up before v1.0). Give me a good reason,
> and I might do it earlier.
>

Am not sure that I understand what you are saying here but, after I've
tried it, I'll read this paragraph again to see if I then understand it.

> For Maildir nested folders, it will NOT create new/cur/tmp folders for
> the higher folders (i.e. [Gmail] will not have new/cur/tmp folders).
>

What if the "higher" folders contain messages (as might be the case
when the higher folder is the INBOX)?

> I will upload this to the SVN later today.
>

I downloaded it but won't have time until the weekend to try it.

Thank you for your dedication.

My best regards.

--
My

Daniel Roesler

unread,
Jan 14, 2009, 11:24:44 AM1/14/09
to imap...@googlegroups.com
On Wed, Jan 14, 2009 at 9:36 AM, My BSD <MyBSD+I...@postpro.net> wrote:
>
> Then, for Maildir the layout would be something like this?:
>
> / [Gmail]Starred/{cur,new,tmp}
> / [Gmail]OtherFolder/{cur,new,tmp}

For example, if your IMAP server looks like:
INBOX
[Gmail]
[Gmail]/Trash
[Gmail]/Starred
[Gmail]/Spam
Receipts
Mailing Lists

If you want to download INBOX, [Gmail]/Starred, and Receipts, you
would use -m "INBOX, [Gmail]/Starred, Receipts". With mbox, you would
end up with something like:
/home/user/imapgrab/INBOX.mbox
/home/user/imapgrab/Receipts.mbox
/home/user/imapgrab/[Gmail]/Starred.mbox

With Maildir (-M), you would end up with something like:
/home/user/imapgrab/INBOX/new/
/home/user/imapgrab/INBOX/cur/
/home/user/imapgrab/INBOX/tmp/
/home/user/imapgrab/Receipts/new/
/home/user/imapgrab/Receipts/cur/
/home/user/imapgrab/Receipts/tmp/
/home/user/imapgrab/[Gmail]/Starred/new/
/home/user/imapgrab/[Gmail]/Starred/cur/
/home/user/imapgrab/[Gmail]/Starred/tmp/

>> However, if the mailbox you want to download has a "/" (or os.sep in
>> python) in the name, imapgrab will create a directory for that as
>> well. I would have to go into the IMAP response for "List" (i.e. look
>> at HasChildren part) to fix this, but I don't plan on doing that for a
>> while (maybe in v0.9 to clean up before v1.0). Give me a good reason,
>> and I might do it earlier.
>>
>
> Am not sure that I understand what you are saying here but, after I've
> tried it, I'll read this paragraph again to see if I then understand it.
>

In the above example, if you had a IMAP mailbox named "Receipts and/or
Tickets" (with a slash in the name). ImapGrab will create a folder
called "Receipts and" and put "or Tickets.mbox" or "or
Tickets/{new,cur,tmp}". In order to fix this you would have to analyze
the metadata that comes with the IMAP list request. I'm probably not
going to worry about it for a while.

>> For Maildir nested folders, it will NOT create new/cur/tmp folders for
>> the higher folders (i.e. [Gmail] will not have new/cur/tmp folders).
>>
>
> What if the "higher" folders contain messages (as might be the case
> when the higher folder is the INBOX)?
>

In the above example, in order to download mail in [Gmail] root
folder, you need to include "[Gmail]" in the -m option. ImapGrab will
not create [Gmail]/{cur,new,tmp} except with "[Gmail]" is in the -m
option


Avast!
Daniel Roesler
dia...@gmail.com

My BSD

unread,
Jan 14, 2009, 3:12:46 PM1/14/09
to imap...@googlegroups.com
On Wed, 14 Jan 2009 10:24:44 -0600
"Daniel Roesler" <dia...@gmail.com> wrote:

> ... <snip> ...

>
> >> However, if the mailbox you want to download has a "/" (or os.sep in
> >> python) in the name, imapgrab will create a directory for that as
> >> well. I would have to go into the IMAP response for "List" (i.e. look
> >> at HasChildren part) to fix this, but I don't plan on doing that for a
> >> while (maybe in v0.9 to clean up before v1.0). Give me a good reason,
> >> and I might do it earlier.
> >>
> >
> > Am not sure that I understand what you are saying here but, after I've
> > tried it, I'll read this paragraph again to see if I then understand it.
> >
>
> In the above example, if you had a IMAP mailbox named "Receipts and/or
> Tickets" (with a slash in the name). ImapGrab will create a folder
> called "Receipts and" and put "or Tickets.mbox" or "or
> Tickets/{new,cur,tmp}". In order to fix this you would have to analyze
> the metadata that comes with the IMAP list request. I'm probably not
> going to worry about it for a while.
>

I understand what you mean now. However, I don't think that should be a
concern because I believe that "/" is not a "legal" character in a folder
name.

... <snip> ...

Thanks for the clarifications.

Daniel Roesler

unread,
Jan 14, 2009, 3:20:43 PM1/14/09
to imap...@googlegroups.com
Ya, but you can still use it in Gmail (I checked), I figured I'd
document the problem on the list. You can use pretty much anything you
want (:;,{}[]/$. etc.), even "\", but that expands to "\\" when you
list it in ImapGrab. Do you know if folder separation characters
change for IMAP servers hosted on Windows? Is "\" used instead of "/"?

Avast!
Daniel Roesler
dia...@gmail.com

My BSD

unread,
Jan 15, 2009, 12:58:39 PM1/15/09
to imap...@googlegroups.com
On Wed, 14 Jan 2009 14:20:43 -0600
"Daniel Roesler" <dia...@gmail.com> wrote:

>
> Ya, but you can still use it in Gmail (I checked), I figured I'd
> document the problem on the list. You can use pretty much anything you
> want (:;,{}[]/$. etc.), even "\", but that expands to "\\" when you
> list it in ImapGrab. Do you know if folder separation characters
> change for IMAP servers hosted on Windows? Is "\" used instead of "/"?
>

> ... <snip> ...

Good question. Don't know about all of them but MailEnable uses "/" as the
separator. Might be worthwhile setting up others in a VirtualBox or Qemu
session to find out.

I know that there is a free five user Communigate offering (top shelf). Also
HMailserver is free but requires a SQL. Am sure that there are many others.

Reply all
Reply to author
Forward
0 new messages