IMAP Server Folder Error

Bug #490248 reported by logic_openerp
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Power Email
Fix Committed
Undecided
Sharoon Thomas http://openlabs.co.in

Bug Description

Hello!
When I configure my account in Configuration - All accounts, I've got an error when I click on select folder button (in incoming):

IMAP Server Folder Error

An error occurred : 'NoneType' object has no attribute 'groups'

I use IMAP, Open ERP 5.0.6 on Ubuntu 9.10 and poweremail 0.6.1.

Thanks

Related branches

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote :

Hi can you paste the full stack trace.
It will be easier to identofy the error.

Also please update to the latest trunk of poweremail

Revision history for this message
logic_openerp (groche) wrote :

Hi,
It is the full stack trace. there is no another message.
But maybe the problem come from my part.
Besides, with the latest trunk of poweremail (0.6.2) I can't access to configuration menu. But this is an other bug...
Thanks

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote :

Hello,

Actually none of these problems are there on our side. Please give sufficient data to replicate the error on our side.

Changed in poweremail:
assignee: nobody → Sharoon Thomas (sharoonthomas)
status: New → Incomplete
Revision history for this message
logic_openerp (groche) wrote :

What do you need exactly to replicate the error?
Thanks

Revision history for this message
Sylvain Calador (sylvain-calador) wrote :

Hello,

To this issue, here is a dump (wireshark) of the imap.online.net IMAP server request/response captured
when pressing "Select Folder" in Inbox configuration.

GPPL2 LIST "" *

* LIST () "/" Trash

* LIST () "/" INBOX/Drafts

* LIST () "/" INBOX/Sent

* LIST () "/" INBOX/SPAM

* LIST () "/" INBOX/Trash

* LIST () "/" INBOX/test

* LIST () "/" Sent

* LIST () "/" Drafts

* LIST () "/" test

* LIST () "/" INBOX

GPPL2 OK LIST completed

It seem to be the regexp in "makereadable" which didn't match:

result = re.search(r'(?:\([^\)]*\)\s\")(.)(?:\"\s)(?:\")([^\"]*)(?:\")', imap_folder)
seperator = result.groups()[0] <- raise exception: AttributeError: 'NoneType' object has no attribute 'groups'

Hope it could help,

Best.

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote :

can you insert a statement in-between line 676 and 677.

print imap_folder

and then lets check what happened with the re.search

Revision history for this message
Sylvain Calador (sylvain-calador) wrote :

The print imap_folder give me:
() "/" Trash

and in the python interpreter:

>>> imap_folder="() \"/\" Trash"
>>> print imap_folder
() "/" Trash
>>> result = re.search(r'(?:\([^\)]*\)\s\")(.)(?:\"\s)(?:\")([^\"]*)(?:\")', imap_folder)
>>> seperator = result.groups()[0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'groups'

I'm not sure how to patch this (if necessary), I don't want to break someting.

Thanks

Revision history for this message
Sylvain Calador (sylvain-calador) wrote :

Ok the imap.online.net server don't use " for delemiting folder
so " is optional (I don't know which server it is and if it respects RFC)

Here is a small patch (need review):

=== modified file 'poweremail_core.py'
--- poweremail_core.py 2009-11-28 11:20:36 +0000
+++ poweremail_core.py 2009-11-30 16:09:00 +0000
@@ -674,7 +674,7 @@

     def makereadable(self, imap_folder):
         if imap_folder:
- result = re.search(r'(?:\([^\)]*\)\s\")(.)(?:\"\s)(?:\")([^\"]*)(?:\")', imap_folder)
+ result = re.search(r'(?:\([^\)]*\)\s\")(.)(?:\"\s)(?:\")?([^\"]*)(?:\")?', imap_folder)
             seperator = result.groups()[0]
             folder_readable_name = ""
             splitname = result.groups()[1].split(seperator) #Not readable now

Thanks to tell me if it can be include in trunk.

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote :

I have committed a fix by Revision ID: <email address hidden>

Could you please check if its ok now?

Changed in poweremail:
status: Incomplete → Fix Committed
Revision history for this message
Sylvain Calador (sylvain-calador) wrote :

thanks it is working now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.