syncing custom IMAP flags
Nicolas Sebrecht
nicolas.s-dev at laposte.net
Sun Nov 21 15:11:24 GMT 2010
On Sat, Nov 20, 2010 at 12:39:29PM -0500, Dan Christensen wrote:
> Nicolas Sebrecht <nicolas.s-dev at laposte.net> writes:
>
> > On Thu, Nov 18, 2010 at 06:08:06PM -0500, Dan Christensen wrote:
> >> Dan Christensen <jdc at uwo.ca> writes:
> >>
> >> [Note added: I don't think the above special case is really a good idea.
> >
> > Yes. I'd rather not to have to maintain any specific hard code to a
> > particular case like this. The solution has to be much more generic than
> > that.
> >
> >> > Alternatively, could offlineimap handle the IMAP --> IMAP case
> >> > separately and simply copy the flags as is?
>
> You didn't respond to this option. I don't know enough about the code
> to know whether it is easy to implement, but it would be great if
> offlineimap simply transparently handled synchronization of all IMAP
> flags without any user customization.
Why not. I didn't look at the code (and don't know enough myself too) to
know if it is reliable but I may merge a seperated well-tested patch for
this case.
> > We may want to add all the real and tested cases we know in the
> > offlineimap.conf file.
>
> The monkeypatching has to be in .offlineimap.py, but it could be
> documented in the advanced settings section of offlineimap.conf. I
> agree that this would be sufficient. For example:
>
> # If you want to synchronize custom IMAP flags, the table for
> # mapping flags between IMAP and Maildir needs to be updated.
> # (This needs to be done even for IMAP to IMAP synchronization,
> # since internally offlineimap views the local IMAP server as
> # a virtual Maildir.)
> #
> # For example, to synchronize some flags that Gnus uses, you
> # can set
> #
> # pythonfile = ~/.offlineimap.py
> #
> # and add the following code to .offlineimap.py (without the
> # leading "#" on each line):
> #
> # import offlineimap.imaputil as IU
> # if not hasattr(IU, 'monkeypatchdone'):
> # IU.flagmap += [('gnus-expire','E'),
> # ('gnus-dormant', 'Q'),
> # ('gnus-save', 'V'),
> # ('gnus-forward', 'W')]
> # IU.monkeypatchdone = True
Couldn't it be more user oriented without needs to touch .offlineimap.py
at all? The main defect I see of the current implementation is that it
would affect all repositories.
I was thinking to something like :
# [Repository Blah]
# extraflags = [('gnus-expire','E'),
# ('gnus-dormant', 'Q'),
# ('gnus-save', 'V'),
# ('gnus-forward', 'W')]
--
Nicolas Sebrecht
More information about the OfflineIMAP-project
mailing list