3 patch series on folder/Maildir cleanup

Nicolas Sebrecht nicolas.s-dev at laposte.net
Sun Jun 12 19:34:47 UTC 2011


On Fri, Jun 10, 2011 at 05:29:58PM +0200, Sebastian Spaeth wrote:
> Please find as reply a series against next that I have been cooking
> up. My initial goal was to implement a more efficient "rename" function
> for Maildirs, as we currently read the full mail content and save it
> again, just to change a mails ID (e.g. on upload to a mail
> server). However, I did not yet get there, as I found too much in
> savemessage() that bothered me.
> 
> What this topic does:
> 
> 1) folder/Maildir: cache getfullname() value
> goal: perform faster (caching something that we calculated A LOT
> 4 insertions(+), 1 deletions(-)
> 
> 2) folder/Maildir: Store only relative filename components
> goal: Use less RAM during synch with basically no perf penality
> 29 insertions(+), 18 deletions(-)
> 
> 3) Simplify Maildir message saving
> goal:  Better Exception throwing (OfflineImapError), true atomicity on
> file opening, in less code.
> 24 insertions(+), 37 deletions(-)
> 
> There are no user visible changes, but I added an entry to the Changelog.
> I have tested that it actually works.

I first applied these topics and finally reverted them because it's
broken:

 WARNING: ERROR attempting to sync flags for account dev:Traceback (most
recent call last):
  File "/usr/lib64/python2.5/site-packages/offlineimap/folder/Base.py", line 413, in syncmessagesto
    action(dstfolder, statusfolder)
  File "/usr/lib64/python2.5/site-packages/offlineimap/folder/Base.py", line 310, in syncmessagesto_copy
    self.copymessageto(uid, dstfolder, statusfolder, register = 0)
  File "/usr/lib64/python2.5/site-packages/offlineimap/folder/Base.py", line 262, in copymessageto
    self.savemessage(newuid, message, flags, rtime)
  File "/usr/lib64/python2.5/site-packages/offlineimap/folder/Maildir.py", line 252, in savemessage
    os.utime(os.path.join(tmpdir, tmpmessagename), (rtime, rtime))
NameError: global name 'tmpmessagename' is not defined

Don't have time to look futher, sorry.

-- 
Nicolas Sebrecht



More information about the OfflineIMAP-project mailing list