Jesse Norell wrote:
Hello,
I don't think the idea will work because IMAP doesn't have a "move"
command. To move a message, it is first copied from one folder to
another (via APPEND, I believe), then a second command is issued to
delete the original message.
Is it done the same way in dbmail? I presumed that in dbmail it's a
matter of changing the folder ID for the mail.
About detecting a move: if I move a message, aren't COPY and DELETE
executed consecutively. Kind of in one go for one mail and therefore
detectable?
Aside from that, can't you just use a database trigger to do what you
want today?
That was my first idea, but: "|CREATE TRIGGER| was added in MySQL 5.0.2.
Currently, its use requires the |SUPER| privilege." I don't use MySQL 5
yet, for other reasons and this solution would be too database dependent.
Thomas Mueller wrote:
But I still don't like the idea of firing triggers. I'd prefer adding a
table that could hold the messageid, from_folder_id, to_folder_id.
If a message is copied from folder family/ to Spam/ from would be
family, to would be Spam.
The folders table would need a 'boolean record_changes' (for Spam/ this
would be true) and that's it. External software could do what ever logic
is required on any machine that has a database connection.
That sounds like a really good idea. Thanks!
Although, here's the thing. When a move has occured, dbmail has to check
wether it's one of the spam folders, that was involved (tracking all
moves from all folders would be quite an overkill I think). In my
installation the number spam folders equals to the number of users. So
when adding a user, the id of the spam folder has to be added to the
spam_folders list. It's not much of the problem for I guess, but still
makes things more complicated.
So it's just a question of detecting a move now. Does anybody have more
insight on this?