IMAP Server Folder Error

Bug #490248 reported by logic_openerp on 2009-11-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Power Email
Fix Committed
Sharoon Thomas

Bug Description

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.


Related branches

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

logic_openerp (groche) wrote :

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


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
logic_openerp (groche) wrote :

What do you need exactly to replicate the error?


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


* LIST () "/" Trash

* LIST () "/" INBOX/Drafts

* LIST () "/" INBOX/Sent


* 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 ='(?:\([^\)]*\)\s\")(.)(?:\"\s)(?:\")([^\"]*)(?:\")', imap_folder)
seperator = result.groups()[0] <- raise exception: AttributeError: 'NoneType' object has no attribute 'groups'

Hope it could help,


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

print imap_folder

and then lets check what happened with the

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

and in the python interpreter:

>>> imap_folder="() \"/\" Trash"
>>> print imap_folder
() "/" Trash
>>> result ='(?:\([^\)]*\)\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.


Ok the 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 ''
--- 2009-11-28 11:20:36 +0000
+++ 2009-11-30 16:09:00 +0000
@@ -674,7 +674,7 @@

     def makereadable(self, imap_folder):
         if imap_folder:
- result ='(?:\([^\)]*\)\s\")(.)(?:\"\s)(?:\")([^\"]*)(?:\")', imap_folder)
+ result ='(?:\([^\)]*\)\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.

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

thanks it is working now.

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

Other bug subscribers