Subject: Re: [sup-devel] Storing message tags and other Sup info as headers in Maildir

From: Sean Whitton <[email-masked]>
Date: Wed, 9 Jun 2010 18:42:08 +0100

Hi Matti,

Thanks for the informative reply.  IMAP user-defined flags sound like an 
excellent way to go about this, but of course, not everyone uses dovecot 
(dunno why!).  Let me know how you get on.

On Tue, Jun 08, 2010 at 06:14:08AM +0300, Matti Eiden wrote:
> I was expecting somebody else to reply in this but since I'm not
> seeing anyone doing so, I'll give it a shot. I only recently
> discovered sup, and I'm not a Ruby programmer, however I got quite a
> bunch of experience with Python (now the rest of the mailing list can
> proceed flaming me). The following post is purely speculative.
> 
> Shortly put, I don't expect to see any change on this matter, at least
> in the near future. There is and has been a tool, sup-sync-back which
> should reflect the changes back to mbox/maildir but the way it works
> is far from ideal, I guess. Anyway..

I keep hearing about sup-sync-back but I'm not sure really what it does.  
Where can I find information about it?

S

-- 
Sean Whitton / <[email-masked]>
OpenPGP KeyID: 0x3B6D411B
http://seanwhitton.com/

_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Sean Whitton <[email-masked]>
Date: Fri, 4 Jun 2010 14:44:04 +0100

Dear all,

I've been checking back to the Sup website every few months for the past 
year or so, waiting until Sup starts to look more stable and suitable 
for regular use.  Like many people on this list, a great stumbling block 
to adoption is the fact that Sup doesn't really let you access your 
e-mail with anything other than Sup.  At the moment I use offlineimap 
and read my mail with Mutt, but my phone and SquirrelMail can access the 
Maildir just as well (by IMAP in the former case), and so everything 
stays in sync and I can get to my e-mail from many places.

Now, I am no real coder, and I've never written a line of ruby, but a 
thought has occurred to me that I feel I should at least share, even if 
it turns out to be completely impractical.  Why not store the 
information associated with e-mails that is not rebuildable (that is, 
tags, unread/read status, starred status, archived/killed/spam status) 
as header lines (X-Sup-Tags: X-Sup-Status, and I guess read/unread could 
be standard Maildir flags) in the e-mails themselves in the Maildir?

This way, the Sup index could be rebuilt on multiple client machines 
without any data actually going out of sync.  You'll still have a 
punishing index rebuild every time you view your mail on a new machine, 
but they'll never be the problem of things actually being wrong - tags 
and stars and the like can all be propagated by offlineimap/IMAP.  The 
indexer can rip out these flags into its index to maintain Sup's 
professed speed, and then if they change, write them back into the 
Maildir along with read/unread status and other flags.

Does this exposition make sense?  Is this a practical way to 
improve/create Sup's multi-client support?

S

---

From: Matti Eiden <[email-masked]>
Date: Tue, 8 Jun 2010 06:14:08 +0300

Hi Sean,

Let's get one thing straight first, sup doesn't really use specific
status flags/tags or such for mails. Instead, every piece of
information is in the labels. A couple of labels are predefined:
Attachment, Deleted, Draft, Inbox, Killed, Sent, Spam, Starred and
Unread. Technically, a message that is archived is simply lacking the
label "Inbox". Rest of the labels are user-defined.

Standard maildir format already provides following flags by default:
(S)een, (T)rashed, (D)raft. In addition flags that sup doesn't need;
Passed, Replied and Flagged.

Dovecot (an IMAP server) provides user defined flags for maildirs. The
flags are lowercase letters ranging a-z (up to 26 different), and
seems like it works OK with the maildir. (
http://wiki.dovecot.org/MailboxFormat/Maildir ). This could be one
nice option if a limit of some 20 user tags aren't too few.

Example maildir mail flags:
:2,Sacd

S - standard maildir flag: Seen, MUA would label as "Read"
a - custom flag - MUA would label as "Archived"
b - custom flag - MUA would label as "Starred"
d - custom flag - User would label as "Work"

This is of course kinda opposite to sup's current situation where
messages are defined as Unread or Inbox, but anyway..

Personally I don't like the idea of MUA messing up with the email
headers as you suggested. Plus, this would result in a lot of
fragmentation on a hard disk with tens of thousands of emails, if on
initial sync sup would need to write label information in the middle
of every email. And as always when writing, there's a risk of data
loss, which would require additional measures.

This area interests me, however, and I guess I'm gonna make some
experiments how the flagging thing works in action, and if it makes
other mail clients break. (I doubt it does, otherwise Dovecot wouldn't
be using it, huh?).

Regards,
Matti