Locally created mailboxes not synchronized to IMAP

Vladimir Marek Vladimir.Marek at Oracle.COM
Tue Aug 16 07:47:42 BST 2011


> > diff --git a/offlineimap/repository/Maildir.py b/offlineimap/repository/Maildir.py
> > index 069748a..c4b527d 100644
> > --- a/offlineimap/repository/Maildir.py
> > +++ b/offlineimap/repository/Maildir.py
> > @@ -132,8 +132,10 @@ class MaildirRepository(BaseRepository):
> >              toppath = root
> >          self.debug("  toppath = %s" % toppath)
> >  
> > +	#print "!!!!!!!!!!!!!!!!"
> > +	#print os.listdir(toppath)
> >          # Iterate over directories in top & top itself.
> > -        for dirname in os.listdir(toppath) + ['.']:
> > +        for dirname in os.listdir(toppath):
> >              self.debug("  *** top of loop")
> 
> Careful here! I just had to fix this code as I had it broken before. We
> do want to examine all directories *including* the current one. What is
> the reason for removing this?
> You are omitting the top directory now!

Would you know how to reproduce that?

I am having IMAP structure like

outside
 mail
 mail
outside/inside
         mail
        mail

Now I am trying different nametrans

 * re.sub('^outside/?', '', foldername)
 WARNING: ERROR Attempting to create folder :Traceback (most recent call last):
  File "/builds/vm156888/offlineimap/offlineimap/repository/Base.py", line 147, in syncfoldersto
    copyfolder.makefolder(key.replace(dest.getsep(), copyfolder.getsep()))
  File "/builds/vm156888/offlineimap/offlineimap/repository/LocalStatus.py", line 72, in makefolder
    os.rename(filename + ".tmp", filename)
OSError: [Errno 21] Is a directory


 * re.sub('^outside/', '', foldername)

That creates
maildir/inside
maildir/inside/cur
maildir/inside/new
maildir/inside/new/U=5,FMD5=335cf4508dd597be4bfc9caa3e08b901:2,
maildir/inside/tmp
maildir/outside
maildir/outside/cur
maildir/outside/cur/U=1,FMD5=c30163615770c8b2b8873288e828de41:2,S
maildir/outside/new
maildir/outside/tmp

 * re.sub('^outside/?', '.', foldername)
maildir/new
maildir/cur
maildir/cur/U=1,FMD5=5058f1af8388633f609cadb75a75dc9d:2,S
maildir/tmp
maildir/.inside
maildir/.inside/tmp
maildir/.inside/cur
maildir/.inside/new
maildir/.inside/new/U=5,FMD5=73ee1943692f76db315f5374b153650b:2,

 * re.sub('^outside/?', '/', foldername) + local repo sep = /
 WARNING: ERROR Attempting to create folder /inside:Traceback (most recent call last):                                                                                            
  File "/builds/vm156888/offlineimap/offlineimap/repository/Base.py", line 145, in syncfoldersto                                                                                  
    dest.makefolder(key)                                                                                                                                                          
  File "/builds/vm156888/offlineimap/offlineimap/repository/Maildir.py", line 85, in makefolder                                                                                   
    assert not foldername.startswith('/'), "Folder names may not begin with /"                                                                                                    
AssertionError: Folder names may not begin with /  

I'm running out of ideas :)
-- 
	Vlad




More information about the OfflineIMAP-project mailing list