Complete.Org: Mailing Lists: Archives: offlineimap: February 2003:
Re: Newbie questions
Home

Re: Newbie questions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Randy Orrison <randy@xxxxxxxxxxx>
Cc: offlineimap@xxxxxxxxxxxx
Subject: Re: Newbie questions
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: Mon, 24 Feb 2003 16:02:08 -0600

On Mon, Feb 24, 2003 at 09:47:19PM +0000, Randy Orrison wrote:
> It failed saying '' is an invalid folder name -- presumably what it got left
> with with for INBOX.  I've done a few experiments and it's now working for
> my subfolders using
> 
>   nametrans = lambda foldername: re.sub('^INBOX.', '.', foldername)

Try this:

nametrans = lambda foldername: foldername == 'INBOX' and 'INBOX' or 
re.sub('^INBOX', '', foldername)

You could also do this by using a pythonfile (see the manpage).

Your ~/.offlineimap.py would contain:

def getfoldername(foldername):
    if foldername == 'INBOX':
        return 'INBOX'
    else:
        return re.sub('^INBOX', '', foldername)

Then in .offlineimaprc:

[general]
pythonfile = ~/.offlineimap.py

[per-account]
nametrans = getfoldername

> which obviously fails for INBOX (it leaves it alone).  Is there some easy
> way that I can do both: change 'INBOX.foo' to '.foo' and 'INBOX' to '.'?
> (I suppose I could do it with a real python function, but I don't know any
> python at all.)

OfflineIMAP will not support a folder named "." as that is a reserved filename
on Unix systems.  However, you could probably get by with a single symlink
for your Courier purposes using the above scheme.

-- John


[Prev in Thread] Current Thread [Next in Thread]