better nametrans documentation available
    John Steele Scott 
    toojays at toojays.net
       
    Sat May 12 11:26:38 BST 2012
    
    
  
On 14/02/12 01:47, Sebastian Spaeth wrote:
> Hi all, the need to have a "reverse" nametrans on the local repository
> has not really been communicated or documented well, I believe. At least
> a partial remedy is the new file docs/dev-docs-src/nametrans.rst which I
> just committed to git. It leads to better user documentation available
> immediately:
> 
> http://docs.offlineimap.org/en/latest/nametrans.html
> 
> I would be glad if people could point to this, if this comes up
> repeatedly. Also I am happy to take patches to improve the
> documentation.
> 
> Especially this part may be relevant:
> http://docs.offlineimap.org/en/latest/nametrans.html#reverse-nametrans
The example for reverse nametrans against a Courier server converts "INBOX" to "INBOXINBOX".
Could be fixed along the following lines:
diff --git a/docs/doc-src/nametrans.rst b/docs/doc-src/nametrans.rst
index ca25345..3400b22 100644
--- a/docs/doc-src/nametrans.rst
+++ b/docs/doc-src/nametrans.rst
@@ -104,9 +104,10 @@ Take the above examples. If your remote nametrans setting was::
 
    nametrans = lambda folder: re.sub('^INBOX\.', '', folder)
 
-then you will want to have this in your local repository, prepending "INBOX" to any local folder name::
+then you will want to have this in your local repository, prepending "INBOX" to
+any local folder name (apart from "INBOX" itself)::
 
-   nametrans = lambda folder: 'INBOX' + folder
+   nametrans = lambda folder: folder if folder == 'INBOX' else 'INBOX.' + folder
 
 Failure to set the local nametrans rule will lead to weird-looking error messages of -for instance- this type::
cheers,
John
    
    
More information about the OfflineIMAP-project
mailing list