Unable to fetch from CGPro server

11 views
Skip to first unread message

My BSD

unread,
Jan 19, 2009, 8:22:34 AM1/19/09
to imap...@googlegroups.com
Good day Daniel.

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

Daniel Roesler

unread,
Jan 19, 2009, 1:50:10 PM1/19/09
to imap...@googlegroups.com
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.

Avast!
Daniel Roesler
dia...@gmail.com
imapgrab-0.1.1_debug_imap_list.py

My BSD

unread,
Jan 19, 2009, 2:56:06 PM1/19/09
to imap...@googlegroups.com
On Mon, 19 Jan 2009 12:50:10 -0600
"Daniel Roesler" <dia...@gmail.com> wrote:

> 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.

IG_dbg-200901191444.txt

Daniel Roesler

unread,
Jan 19, 2009, 3:34:18 PM1/19/09
to imap...@googlegroups.com
Ok, try this version. I've changed the parser so it gets everything
after '" ', then strips quotes, if they're there.

Avast!
Daniel Roesler
dia...@gmail.com
> DEBUG_000: parsed options:
> {'username': ' ... ', 'all': None, 'maildir': True, 'debug': True, 'list': True, 'mailboxes': None, 'server': ' ... ', 'quiet': None, 'ssl': None, 'version': None, 'download': None, 'about': None, 'folder': None, 'password': ' .... ', 'mbox': None, 'port': '143', 'verbose': None}
> DEBUG: parsed arguments:
> []
> IMAP Grab 0.1
> ---
> DEBUG_004: -l parsed, calling list function
> DEBUG_008: no -S parsed, connecting with no SSL
> DEBUG_010: sending username/password to server
> DEBUG_011: connected to IMAP server
> DEBUG_012: got list of mailboxes:
> ('OK', ['(\\UnMarked) "/" Domains', '(\\UnMarked) "/" INBOX', '(\\UnMarked) "/" INBOX/Storage', '(\\UnMarked) "/" INBOX/Temp', '(\\UnMarked) "/" S2009', '(\\UnMarked) "/" System', '(\\UnMarked) "/" T2008', '(\\UnMarked) "/" U2007', '(\\UnMarked) "/" V2006', '(\\UnMarked) "/" YInbox', '(\\Marked) "/" ZInbox'])
> Traceback (most recent call last):
> File "imapgrab-0.1.1_debug_imap_list.py", line 401, in <module>
> imapgrab()
> File "imapgrab-0.1.1_debug_imap_list.py", line 146, in imapgrab
> ig_list = IG_list_mailboxes(ig_options)
> File "imapgrab-0.1.1_debug_imap_list.py", line 200, in IG_list_mailboxes
imapgrab-0.1.1_imap_list_quotes.py

My BSD

unread,
Jan 19, 2009, 5:49:39 PM1/19/09
to imap...@googlegroups.com
On Mon, 19 Jan 2009 14:34:18 -0600
"Daniel Roesler" <dia...@gmail.com> wrote:

> 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!

Daniel Roesler

unread,
Jan 19, 2009, 6:54:35 PM1/19/09
to imap...@googlegroups.com
Good to know. Created a new release on sourceforge and website.

Avast!
Daniel Roesler
dia...@gmail.com
Reply all
Reply to author
Forward
0 new messages