19 Sep 2011 14:39
New folder creation on REMOTE (DO READ)
Sebastian Spaeth <Sebastian <at> SSpaeth.de>
2011-09-19 12:39:03 GMT
2011-09-19 12:39:03 GMT
Hot on the heels of my temp. maintainership, I take the chance to push a
revised branch that implements the automatic creation of remote folders.
We implement a sanity check that will stop if you are using nametrans
rules and they do not lead to the same name when applied back and forth.
If you don't use nametrans, everything is cool and you can stop reading here.
If you use nametrans on the remote repository, you will need a nametrans
rule on the local repository that reverses the name.
So if REMOTE nametrans = lambda f: "INBOX." + f
you need a LOCAL nametrans rule that does
nametrans = lambda f: re.sub("^INBOX.", "", f)
If you don't get it right, OfflineImap will perform a sanity check and
complain that the back and forth resolution does not lead to identical
names. and refuse to create the folder on the remote repository.
This feature will probably require some more documentation extensions
and typical use cases, which I will add in the near future.
With this feature, I consider the next stable version feature complete,
and will freeze feature work, and stabilize the 'next' branch so we can
release a new stable soonish.
Do let me know if and how things work (or break), the change should be
rather safe even if it requires one more nametrans setting.
Sebastian
(Continue reading)
My setup is like this:
[Repository here]
type = IMAP
folderfilter = lambda f: not re.search('^_', f)
nametrans = lambda f: re.sub ('^INBOX/INBOX$', 'INBOX', 'INBOX/' + f)
[Repository ensl_imap]
type = IMAP
nametrans = lambda f: re.sub ('^INBOX/', '', f)
and I get an error on a folder that exists on both sides (and was synced
perfectly well before the change, it is not a new folder):
ERROR: Exceptions occurred during the run!
ERROR: Creating folder enseignement on repository here
Folder 'enseignement'[here] could not be created.
Server responded: ('NO', ['[ALREADYEXISTS] Mailbox already exists:
enseignement'])
ERROR: Folder 'enseignement'[here] could not be created.
Server responded: ('NO', ['[ALREADYEXISTS] Mailbox already exists:
enseignement'])
Sebastian
RSS Feed