mbnames

Paul Collignan p at ul.collignan.fr
Sun Jan 8 11:59:53 GMT 2012


On Sun, Jan 08, 2012 at 12:38:59PM +0100, Sebastian Spaeth wrote:
> On Sun, 08 Jan 2012 12:02:44 +0100, Paul Collignan <p at ul.collignan.fr> wrote:
> > I use offlineimap to sync a remote courrier IMAP account and a local 
> > Maildir. I use nametrans to get rid of the courrier INBOX. useless 
> > string:
> > nametrans = lambda foldername: re.sub('^INBOX\.*', '', foldername)
> > and
> > nametrans = lambda f: "INBOX." + f
> > and it works well. In fact without those two lines it does not work at 
> > all.
> I would be interested to hear why it doesn't work without those, but
> that's a different story.

the first sync works well, while the second one does not:

*** Processing account Perso
Establishing connection to rhodes.sud-ouest.org:993
Creating new IMAP folder '.' on server perso-remote
ERROR: Creating folder  on repository perso-remote
  Folder '.'[perso-remote] could not be created. Server responded: ('NO', ['Invalid mailbox name.'])
ERROR: Folder '.'[perso-remote] could not be created. Server responded: ('NO', ['Invalid mailbox name.'])
*** Finished account 'Perso' in 0:00
ERROR: Exceptions occurred during the run!
ERROR: Creating folder  on repository perso-remote
  Folder '.'[perso-remote] could not be created. Server responded: ('NO', ['Invalid mailbox name.'])
ERROR: Folder '.'[perso-remote] could not be created. Server responded: ('NO', ['Invalid mailbox name.'])

Folders on perso-remote (courier IMAP) are:
INBOX
INBOX.Draft
INBOX.Sent
aso.

> 
> > My problem is that mbnames keeps the INBOX. substring in mailboxes 
> > names, so mutt is not able to find the corresponding Maildirs.
> 
> This could be a side-effect of the recent introduction of server side
> folder creation, which led to the introduction of "nametrans" rules on
> the LOCAL repository.
> 
> The foldername being written is determined here:
> accounts.py:l377
>         # Write the mailboxes
>         mbnames.add(account.name, localfolder.getvisiblename())
> 
> getvisiblename() transforms the folder name according to the
> nametransrule which is generally not what we want, I believe.
> 
> Can you replace that line in accounts.py:
> -        mbnames.add(account.name, localfolder.getvisiblename())
> +        mbnames.add(account.name, localfolder.getname())
> 
> and see whether the results are better?
> If yes, I believe we should change that in the code. We clearly want the

That solved my problem, thank you very much. Should I fill a bug report
or something? I never wrote a patch or anything…

> local names and not the translated names here.
> _______________________________________________
> OfflineIMAP-project mailing list
> OfflineIMAP-project at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/offlineimap-project
> 
> OfflineIMAP homepage: http://software.complete.org/offlineimap





More information about the OfflineIMAP-project mailing list