Merge lp://qastaging/~sylvain-calador/poweremail/imap-folder-name-with-space into lp://qastaging/poweremail/trunk

Proposed by Sylvain Calador
Status: Merged
Merged at revision: not available
Proposed branch: lp://qastaging/~sylvain-calador/poweremail/imap-folder-name-with-space
Merge into: lp://qastaging/poweremail/trunk
Diff against target: 32 lines (+4/-4)
1 file modified
poweremail_core.py (+4/-4)
To merge this branch: bzr merge lp://qastaging/~sylvain-calador/poweremail/imap-folder-name-with-space
Reviewer Review Type Date Requested Status
Sharoon Thomas http://openlabs.co.in Approve
Review via email: mp+16118@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Sylvain Calador (sylvain-calador) wrote :

Hi,

There is a bug with IMAP folder's name with space.
This branch fix it.

Best regards,

Sylvain

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

Thanks for your contribution.
I am merging it right away.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'poweremail_core.py'
2--- poweremail_core.py 2009-12-08 13:33:45 +0000
3+++ poweremail_core.py 2009-12-14 09:54:15 +0000
4@@ -505,12 +505,12 @@
5 logger.notifyChannel(_("Power Email"), netsvc.LOG_INFO, _("IMAP Server Connected & logged in successfully Account:%s.") % (id))
6 #Select IMAP folder
7 try:
8- typ, msg_count = serv.select(rec.isfolder)
9+ typ, msg_count = serv.select('"%s"' % rec.isfolder)
10 except imaplib.IMAP4.error, error:
11 logger.notifyChannel(_("Power Email"), netsvc.LOG_ERROR, _("IMAP Server Folder Selection Error Account:%s Error:%s.") % (id, error))
12 raise osv.except_osv(_('Power Email'), _('IMAP Server Folder Selection Error Account:%s Error:%s.\nCheck account settings if you have selected a folder.') % (id, error))
13 logger.notifyChannel(_("Power Email"), netsvc.LOG_INFO, _("IMAP Folder selected successfully Account:%s.") % (id))
14- logger.notifyChannel(_("Power Email"), netsvc.LOG_INFO, _("IMAP Folder Statistics for Account:%s:%s") % (id, serv.status(rec.isfolder, '(MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)')[1][0]))
15+ logger.notifyChannel(_("Power Email"), netsvc.LOG_INFO, _("IMAP Folder Statistics for Account:%s:%s") % (id, serv.status('"%s"' % rec.isfolder, '(MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)')[1][0]))
16 #If there are newer mails than the ones in mailbox
17 #print int(msg_count[0]),rec.last_mail_id
18 if rec.last_mail_id < int(msg_count[0]):
19@@ -605,11 +605,11 @@
20 logger.notifyChannel(_("Power Email"), netsvc.LOG_INFO, _("IMAP Server Connected & logged in successfully Account:%s.") % (id))
21 #Select IMAP folder
22 try:
23- typ, msg_count = serv.select(rec.isfolder)#typ,msg_count: practically not used here
24+ typ, msg_count = serv.select('"%s"' % rec.isfolder)#typ,msg_count: practically not used here
25 except imaplib.IMAP4.error, error:
26 logger.notifyChannel(_("Power Email"), netsvc.LOG_ERROR, _("IMAP Server Folder Selection Error Account:%s Error:%s.") % (id, error))
27 logger.notifyChannel(_("Power Email"), netsvc.LOG_INFO, _("IMAP Folder selected successfully Account:%s.") % (id))
28- logger.notifyChannel(_("Power Email"), netsvc.LOG_INFO, _("IMAP Folder Statistics for Account:%s:%s") % (id, serv.status(rec.isfolder, '(MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)')[1][0]))
29+ logger.notifyChannel(_("Power Email"), netsvc.LOG_INFO, _("IMAP Folder Statistics for Account:%s:%s") % (id, serv.status('"%s"' % rec.isfolder, '(MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)')[1][0]))
30 #If there are newer mails than the ones in mailbox
31 typ, msg = serv.fetch(str(server_ref), '(FLAGS RFC822)')
32 for i in range(0,len(msg)/2):