[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-devel] A maildir root source: syncing labels with maildirs (imap folders)



Excerpts from Matthieu Rakotojaona's message of 2013-11-27 19:32:02 +0100:
> Excerpts from Gaute Hope's message of 2013-11-27 14:08:36 +0100:
> > I noticed Gmail does it that way in their IMAP interface (archive on no
> > other labels), thats why I did it.
>
> _Any_ email in gmail is also in the All Mail [0], except when it is
> manually moved to the [Gmail]/Trash folder, in which case it disappears
> forever (well, at least for you :). I think this is the best solution,
> because it is the most understandable for all MUAs out there: the fact
> that "a maildir is a label" is something pretty specific to
> gmail-pioneered MUAs, so at least when I backup the [Gmail]/All Mail I
> know I won't have lost any of them (even if I have lost the labels).

Hm ok. I just figured it out by trail-and-error, I probably missed
something. I have changed sync_back to always make sure the message is
present in the archive. This does not have any effect on existing
messages before you do some edit that triggers sync_back. It also
currently does not check new messages (since non-gmail sources will not
have a copy in archive), we should do a check upon :add in
poll.rb#do_poll to the source that checks if existing_sources has
@archive, if not add and return to poll with updated locations (no
sync_back needed and no index sync needed as poll will do that
afterwards).

About deletion, current behavior:
- apply :deleted label; this means:
- the message is moved to the trash folder
- the T flag is added to all the labels it is part of

this might not work exactly as it should on GMail, but it is the only
way to preserve labels (in case of restore).

> Regarding hardlinking, I'm afraid of the cross-platform issues. I know
> some people here use Mac OSX, is it safe to use hardlinking on this
> platform ?

I am using the util function I created for maildir-sync (in develop)
which falls back to copying the file if hardlinking fails, that function
works on Mac OS X. Hardlinking doesn't work for me since I am using
encfs to store mail.


> (Oh and by the way I found a script [1] that basically hardlinks every
> copy of an email, this could be especially useful for gmail-based
> installations)
>
> [0] https://support.google.com/mail/answer/78755?hl=en
> [1] http://jak-linux.org/projects/hardlink/

That could be very useful and run as a cronjob now and then.

- gaute

Attachment: signature.asc
Description: PGP signature