Re: why not use IMAP FLAGS?



also sprach Florian Friesdorf <flow@mytum.de> [2007.07.26.1705 +0200]:
> In IMAP custom flags are called keywords and are stored without
> the leading \, in contrast to system flags.
> 
> With maildirs, flags are encoded into the filename in ASCII order.
> Every program able to read and write filenames could handle them.

Yes, they are, but they're also limited to a few defined ones, or 26
at most.

I've thought about all this a bit now and I really like IMAP flags
a lot, but I have not really understood them yet. In particular,
I am still looking for a specification on what's allowed, and also
for a way to remove flags from enclosing folders.

I can definitely add keywords to folders with dovecot, and you're
welcome to play along, I've set up a test account on
seamus.madduck.net:

$ gnutls-cli -p 993 seamus.madduck.net
[...]
* OK [CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES
MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE
LOGIN-REFERRALS QUOTA AUTH=PLAIN AUTH=LOGIN] Pop the trunk.

a1 LOGIN test@madduck.ch Kie8is7ief
a1 OK Logged in.

a2 SELECT INBOX
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 1 EXISTS
* 1 RECENT
* OK [UNSEEN 1] First unseen.
* OK [UIDVALIDITY 1187881555] UIDs valid
* OK [UIDNEXT 2] Predicted next UID
a2 OK [READ-WRITE] Select completed.

a3 STORE 1 +FLAGS (testflag)
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft testflag)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft testflag \*)] Flags permitted.
* 1 FETCH (FLAGS (\Recent testflag))
a3 OK Store completed.

a4 SELECT INBOX
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft testflag)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft testflag \*)] Flags permitted.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1187881555] UIDs valid
* OK [UIDNEXT 2] Predicted next UID
a4 OK [READ-WRITE] Select completed.

a5 STORE 1 +FLAGS (\Deleted)
* 1 FETCH (FLAGS (\Deleted \Recent testflag))
a5 OK Store completed.

a6 EXPUNGE
* 1 EXPUNGE
* 0 RECENT
a6 OK Expunge completed.

a7 SELECT INBOX
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft testflag)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft testflag \*)] Flags permitted.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1187881555] UIDs valid
* OK [UIDNEXT 2] Predicted next UID
a7 OK [READ-WRITE] Select completed.

a8 CLOSE  
a8 OK Close completed.

a9 LOGOUT
* BYE Logging out
a9 OK Logout completed.

Note how the flag stays on the folder even after expunging the
message: http://dovecot.org/list/dovecot/2007-August/024988.html

What characters are allowed in IMAP keywords? I seem to recall it's
basically [[:alnum:]], but could be wrong. It would mean we have to
use something like utf-7 to store unicode (and we should).

If we could come up with a way to store arbitrary flags in
a Maildir/mailbox, then it would probably be trivial to extend
python's IMAP client and mailbox.Maildir and let offlineimap profit.

>     I think it is not an option to put tags into the header as: it is too slow
>     to open the mails and to read the headers, and mails shouldnt be changed by
>     the mail user agent.

Fair enough.

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:"; net@madduck
 
"arrogance on the part of the meritorious is even more
 offensive to us than the arrogance of those without merit:
 for merit itself is offensive."
                                              -- friedrich nietzsche
 
spamtraps: madduck.bogus@madduck.net

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)



This archive was generated by a fusion of Pipermail (Mailman edition) and MHonArc.