[Dovecot] removing IMAP keywords?
Hi there,
I found that with an IMAP command like
<unique-leader> STORE 1 +FLAGS (testflag)
I can set arbitrary flags on mails through the dovecot IMAP daemon. This rules.
Now I wonder, however, how I can remove those flags, which become properties of the folder, really. For instance, after the above, SELECT on the containing folder gives:
- FLAGS (\Answered \Flagged \Deleted \Seen \Draft testflag)
- OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft testflag \*)] Flags permitted.
Even if I remove the flag from all messages or even delete all messages in the folder, the flag stays on the folder.
Is there an IMAP way of removing flags from a folder?
Also, does someone know where I can find specification on what characters are allowed for keywords? RFC 3501 is strangely quiet on this, or I am blind.
Thanks,
-- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
"gilmour's guitar sounds good whether you've got a bottle of cider in your hand or a keyboard and a mouse." -- prof. bruce maxwell
spamtraps: madduck.bogus@madduck.net
On Thursday, August 23 at 05:14 PM, quoth martin f krafft:
Also, does someone know where I can find specification on what characters are allowed for keywords? RFC 3501 is strangely quiet on this, or I am blind.
Check out section 9, Formal Syntax. Specifically, "flag-keyword", which is defined to be an "atom", which is a sequence of ANY character except the "atom-specials". In other words, a flag-keyword is a string of one or more characters, not including (, ), {, " ", control characters, %, *, ", \, and ].
~Kyle
Truth never damages a cause that is just. -- Mahatma Gandhi
also sprach Kyle Wheeler kyle-dovecot@memoryhole.net [2007.08.23.2103 +0200]:
Check out section 9, Formal Syntax. Specifically, "flag-keyword", which is defined to be an "atom", which is a sequence of ANY character except the "atom-specials". In other words, a flag-keyword is a string of one or more characters, not including (, ), {, " ", control characters, %, *, ", \, and ].
So this would mean we could use UTF-7 (RFC 2152) to encode pretty much anything in those tags.
Is there a maximum length? I could not tell from the document.
-- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
the images rushed around his mind and tried to find somewhere to settle down and make sense. -- douglas adams, "the hitchhiker's guide to the galaxy"
spamtraps: madduck.bogus@madduck.net
On Fri, 2007-08-24 at 08:53 +0200, martin f krafft wrote:
also sprach Kyle Wheeler kyle-dovecot@memoryhole.net [2007.08.23.2103 +0200]:
Check out section 9, Formal Syntax. Specifically, "flag-keyword", which is defined to be an "atom", which is a sequence of ANY character except the "atom-specials". In other words, a flag-keyword is a string of one or more characters, not including (, ), {, " ", control characters, %, *, ", \, and ].
So this would mean we could use UTF-7 (RFC 2152) to encode pretty much anything in those tags.
It could be a good idea to talk about it first in imap-protocol list to see if other people have better ideas.
Is there a maximum length? I could not tell from the document.
No. Dovecot has a setting for the maximum length, which is 50 by default. UW-IMAP has a limit of 30 I think. I don't know about others.
As for removing keywords, I was planning on implementing it for v1.1, but it got delayed. The idea was anyway that if keyword is unused it would be removed automatically after a while, possibly only if the Maildir's 26 keyword limit is reached. I hadn't thought about exact rules yet. In any case there is no IMAP command for it.
also sprach Timo Sirainen tss@iki.fi [2007.08.24.1654 +0100]:
It could be a good idea to talk about it first in imap-protocol list to see if other people have better ideas.
This is a good idea. However, in a thread on the mailtags mailing list, the Mail.app MailTags author raised some concerns with using IMAP keywords for mail tags [0], which need to be addressed/discussed first. Basically, using an RFC821 header to store tags in the message is a considerable contender with a major performance downside, but it would solve the challenge of storing tags locally in a way that *all* mail clients could use.
-- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
microsoft: for when quality, reliability, and security just aren't that important!
spamtraps: madduck.bogus@madduck.net
On Thu, 23 Aug 2007, martin f krafft wrote:
Hi there,
I found that with an IMAP command like
<unique-leader> STORE 0 +FLAGS (testflag)
I can set arbitrary flags on mails through the dovecot IMAP daemon. This rules.
Now I wonder, however, how I can remove those flags, which become properties of the folder, really. For instance, after the above, SELECT on the containing folder gives:
- FLAGS (\Answered \Flagged \Deleted \Seen \Draft testflag)
- OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft testflag \*)] Flags permitted.
Even if I remove the flag from all messages or even delete all messages in the folder, the flag stays on the folder.
Is there an IMAP way of removing flags from a folder?
Funny, I just went through this moments before I saw this message. As far as I know, there is no way to do it other than to delete the dovecot.index files on the server. If you don't have access to the server, then there probably is no way given the current IMAP protocol.
If you do delete the index files, make sure your dovecot-keywords file is correct (any test keywords removed) before reconnecting to the server (probably best to stop it, do the operations, then start the server again). If you use Maildir format, the keywords should match the filenames as described in the wiki:
http://wiki.dovecot.org/MailboxFormat/Maildir#head-4111d229e8294e0c08d88ea31...
Note that if you have more than 26 keywords, some of them will be lost if the index files are deleted.
also sprach Julian Cowley julian@lava.net [2007.08.23.2228 +0200]:
Funny, I just went through this moments before I saw this message. As far as I know, there is no way to do it other than to delete the dovecot.index files on the server. If you don't have access to the server, then there probably is no way given the current IMAP protocol.
Ouch. Thanks for taking the time to respond.
We're discussing how to do general (semantic) mail tags in such a way that they're client and server independent. In case you're interested, please check out the archives of the list and consider signing up:
http://lists.madduck.net/mailman/listinfo/mailtags
-- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
"never trust a woman who wears mauve, whatever her age may be, or a woman over thirty-five who is fond of pink ribbons. it always means they have a history." -- oscar wilde
spamtraps: madduck.bogus@madduck.net
participants (4)
-
Julian Cowley
-
Kyle Wheeler
-
martin f krafft
-
Timo Sirainen