Hi!
I'm fed up with the fact that there are, to my knowledge, no webmail
systems that support tags/labels (with the notable exception of
GMail). So I'm going to do something about it.
I'm going to add tags to Roundcube! =]
I intend to read tags from, and store them as, IMAP Flags. The result
should be somewhat interoperable with Thunderbird and Pine. (I've
never used Pine, so I won't be able to test interop; I'm not a
Thunderbird user but I have installed it and played with its tagging.)
Now to the nitty-gritty.
The plan, so far, is:
imap.inc. They're up-cased, and "SEEN", "DELETED", etc are magical. I
believe a better way to do this is to preserve flag case all the way
through, and use "\Seen", "\Deleted", etc as IMAP does, including the
backslash. Dealing with the backslash can mean some icky-looking
code, but it shouldn't be a big problem.
steps/mail/mark.inc. I need to investigate exactly what this file is
and when it gets called, though.
be especially appreciated here, I have a little UI-fu but I'm not a
designer.
I'll report my progress in this forum thread -> http:// roundcubeforum.net/forum/index.php?topic=340.0 I welcome all questions, comments, suggestions, corrections, and flames!
-joe
Joe Auricchio wrote:
I intend to read tags from, and store them as, IMAP Flags. The result should be somewhat interoperable with Thunderbird and Pine. (I've never used Pine, so I won't be able to test interop; I'm not a Thunderbird user but I have installed it and played with its tagging.)
Now to the nitty-gritty.
The plan, so far, is:
- clean up the way flags are handled in rcube_imap.inc and lib/imap.inc.
They're up-cased, and "SEEN", "DELETED", etc are magical. I believe a better way to do this is to preserve flag case all the way through, and use "\Seen", "\Deleted", etc as IMAP does, including the backslash. Dealing with the backslash can mean some icky-looking code, but it shouldn't be a big problem.
- add API for working with arbitrary tags. I think I'll start with
steps/mail/mark.inc. I need to investigate exactly what this file is and when it gets called, though.
- UI for tags. Not sure whether to clone GMail or what. Input would be
especially appreciated here, I have a little UI-fu but I'm not a designer.
-joe
Implementing them as IMAP flags certainly sounds interesting. I think you'll probably still need a database component though. IMAP is good at returning the flags associated with a single message, but I don't know that it has a method retrieving all flags attached to all the messages in a folder, for instance. I would recommend storing the tags in a table, and using that to populate your various lists of tags, and also use it as the base for applying tags to messages.
I got pretty far along with a tags implementation myself and then abandoned it. I didn't use the IMAP flag capabilities though. I was putting them all in the database along with the IMAP Message-ID, and I was using this library: http://www.getluky.net/freetag/ which is pretty good. The javascript I wrote should still be pretty good, if you'd like to use that as a jumping off point I can post it here or something.
Basically I got as far as tagging messages and seeing those tags in the subject (like gmail) but didn't even get started on "virtual folders" and the like, which of course would be the ultimate goal of such a project.
As far as steps/mail/mark.inc it is used to tag messages as read and deleted only, but it shouldn't be too hard to modify it to pass in arbitrary flags. It's called from within the javascript (app.js) by running an AJAX call with a certain action which then causes index.php to literally include() mark.inc I'm going purely off of memory here and I remember it being a little confusing at first, but it works.
Would you like to IRC or IM about it sometime? I'm not free any evenings this week and I'm out of town this weekend, but I can usually carve out some of my companies time during the day (8AM-5PM CDT)
-Charles
On Aug 9, 2006, at 2:07 PM, Chuck, Charlie and Charles wrote:
Joe Auricchio wrote:
I intend to read tags from, and store them as, IMAP Flags.
I was putting them all in the database along with the IMAP Message-ID, and I was using this library: http://www.getluky.net/freetag/ which is pretty good. The
javascript I wrote should still be pretty good, if you'd like to use that as a jumping off point I can post it here or something.
I've also released a free PHP tagging library called PHP Tag Engine:
It is similar in some ways to FreeTag, however it also includes a
full AJAX front-end UI, I integrated it into my Tasks software in
just a few lines of code. Hopefully it can be of some use to you.
Cheers, --Alex
Personal http://alexking.org Business http://kingdesign.net
On Aug 9, 2006, at 1:07 PM, Chuck, Charlie and Charles wrote:
Implementing them as IMAP flags certainly sounds interesting. I think you'll probably still need a database component though. IMAP is
good at returning the flags associated with a single message, but I don't know that it has a method retrieving all flags attached to all the messages in a folder, for instance. I would recommend storing the tags in a table, and using that to populate your various lists of tags, and also use it as the base for applying tags to messages.
Actually, there's a PERMANENTFLAGS response sent with every SELECT
that lists the flags known to that mailbox. When I discovered that I
was amazed more clients *don't* support tags -- the IMAP server does
all the hard work!!
You're right, though, that there will need to be a global tag cache,
since tags are available only per-box. There seems to be no easy way
to retrieve all flags attached to all the messages in *all* folders,
which is what we really need.
The tags applied to messages should also be cached, but it will be
only a cache, and not authoritative.
I don't know anything about roundcube's caching, so I'll need some
serious help with this when it comes time. I may just write things
the naive way and let someone else handle the caching =]
The javascript Iwrote should still be pretty good, if you'd like to
use that as a jumping off point I can post it here or something. Basically I got as far as tagging messages and seeing those tags in
the subject (like gmail) but didn't even get started on "virtual folders" and the like, which of course would be the ultimate goal of such a
project.
I'm not sure I want to implement full virtual folders, backed by
arbitrary search. I would like to do a list of all messages that
share a tag, in the way Gmail does. When it comes time to do UI, your
code would certainly be helpful!
Would you like to IRC or IM about it sometime? I'm not free any evenings this week and I'm out of town this weekend, but I can usually carve out some of my companies time during the day (8AM-5PM CDT)
I'm in #roundcube on freenode, as either utf8 or jauricchio
(depending on which machine I'm on).
-joe
I've made some changes to the way flags are handled in include/ rcube_imap.inc and lib/imap.inc.
A patch and summary of changes are posted in the forums here: http:// roundcubeforum.net/forum/index.php?topic=340.msg1767#msg1767
I would greatly appreciate code review and/or testing. Thanks!
Looking forward, what's the procedure for getting a patch accepted
into the tree? I'm not quite at that point yet, but it won't be long.
-joe
Joe Auricchio wrote:
I've made some changes to the way flags are handled in include/rcube_imap.inc and lib/imap.inc.
A patch and summary of changes are posted in the forums here: http://roundcubeforum.net/forum/index.php?topic=340.msg1767#msg1767
I would greatly appreciate code review and/or testing. Thanks!
Looking forward, what's the procedure for getting a patch accepted into the tree? I'm not quite at that point yet, but it won't be long.
-joe
Looks like damn good code. I'll patch tonight or tomorrow and let you know if I have any issues.
-Charles
I'm going to give this patch a try as well, I'll let you know what I find.
On 8/10/06, Charles McNulty charles@charlesmcnulty.com wrote:
Joe Auricchio wrote:
I've made some changes to the way flags are handled in include/rcube_imap.inc and lib/imap.inc.
A patch and summary of changes are posted in the forums here: http://roundcubeforum.net/forum/index.php?topic=340.msg1767#msg1767
I would greatly appreciate code review and/or testing. Thanks!
Looking forward, what's the procedure for getting a patch accepted into the tree? I'm not quite at that point yet, but it won't be long.
-joe
Looks like damn good code. I'll patch tonight or tomorrow and let you know if I have any issues.
-Charles