Over the weekend, I tried v. 0.1.1 and am pleased to report that it works as
advertised. That is, when it delivers to Maildirs the resulting folder
layout depends on the server separator.
I maintain mirrors of some of my IMAP accounts on three different boxes with
different IMAP servers. I tested ImapGrab on all three servers. It worked
without incident with the Dovecot and DBMail servers, but did not work with
the Communigate Pro v. 5.1.10 on a Linux server - it would neither list nor
fetch messages.
Command line used:
------------------------------------------------------------------------------------------------------------------------
./imapgrab-0.1.1.py -v -l -s SERVER -P 143 -u USER -p PW
------------------------------------------------------------------------------------------------------------------------
IG's resuIting in error message:
------------------------------------------------------------------------------------------------------------------------
IMAP Grab 0.1
---
List option selected
Connecting to IMAP server
Logging into IMAP server
Traceback (most recent call last):
File "./imapgrab-0.1.1.py", line 399, in <module>
imapgrab()
File "./imapgrab-0.1.1.py", line 146, in imapgrab
ig_list = IG_list_mailboxes(ig_options)
File "./imapgrab-0.1.1.py", line 198, in IG_list_mailboxes
ig_list.append(i.split('"')[3])
IndexError: list index out of range
------------------------------------------------------------------------------------------------------------------------
The corresponding CGPro log entry was:
------------------------------------------------------------------------------------------------------------------------
07:58:15.242 2 IMAP-000209([192.168.1.250]) 'USER' connected from
192.168.1.250]:59943 07:58:15.448 3 IMAP-000209([192.168.1.250]) read failed.
Error Code=connection closed by peer 07:58:15.448 2 IMAP-000209
([192.168.1.250]) 'USER' disconnected ([192.168.1.250]:59943)
------------------------------------------------------------------------------------------------------------------------
By the way, a direct Getmail session works fine.
The "LIST" command for this account yields the following:
------------------------------------------------------------------------------------------------------------------------
. LIST "" "*"
* LIST (\UnMarked) "/" INBOX
* LIST (\UnMarked) "/" INBOX/Storage
* LIST (\UnMarked) "/" INBOX/Temp
* LIST (\UnMarked) "/" S2009
* LIST (\UnMarked) "/" System
* LIST (\UnMarked) "/" T2008
* LIST (\UnMarked) "/" U2007
* LIST (\UnMarked) "/" V2006
* LIST (\UnMarked) "/" YInbox
* LIST (\Marked) "/" ZInbox
. OK completed
------------------------------------------------------------------------------------------------------------------------
Any ideas?
Thank you.
My best regards.
--
My
> It looks like the Communigate Pro v. 5.1.10 is returning a different
> format for the imap.list python function (
> http://www.python.org/doc/2.5.2/lib/imap4-objects.html#l2h-4130 ).
> Unfortunately there is no way to display what that code is with 0.1.1,
> so I've attached a modified version that adds a debug output for the
> imap.list return value. Could you please run a --list on this version
> with the --debug option enabled. For DEBUG_012, an array should print
> with all of your mailboxes and some other stuff.
>
> I currently parse that array by taking splitting double quotes, but
> Communigate might be set up for single quotes.
>
> ... <snip> ...
I think you're on the money. Please see attached (sanitized) debug
session.
> Ok, try this version. I've changed the parser so it gets everything
> after '" ', then strips quotes, if they're there.
>
> ... <snip> ...
That did the trick, thank you.
Was able to list and download all folders.
Good work!