[Dovecot] maildir / deliver question
Hi all,
I have the following situation: On a qmail toaster I am running (with dovecot 1.2.12 as the IMAP server), spam mail gets automatically put into a 'this might be spam' folder (per user).
Now, every user has the opportunity to move that mail into either a 'learn as spam' or a 'this was ham' folder and the mail items will be treated accordingly.
As a cronjob, I run a script that loops through all the users' folders and either learns as spam and deletes or learns as ham and moves back to the user's inbox.
My questions now are these:
1.) Is there any danger regarding maildir consistency in directly moving mail items about?
2.) Could I somehow use deliver to move the mails? I think I can recall that other LDAs (maildrop?) allow for that? This would of course be preferred as the maildir cache would also still be optimized after the operation.
If anyone has any suggestions, I'd really appreciate this.
Thanks a lot for your help and this great tool!
Martin
-- "The nice thing about being a celebrity is that when you bore people, they think it's their fault."
Henry Kissinger
On Sat, 2010-07-10 at 09:14 +0200, Martin Waschbuesch wrote:
1.) Is there any danger regarding maildir consistency in directly moving mail items about?
No. Assuming you use "mv" and not "cp" (and it's all in the same filesystem) so that the move is atomic.
2.) Could I somehow use deliver to move the mails? I think I can recall that other LDAs (maildrop?) allow for that? This would of course be preferred as the maildir cache would also still be optimized after the operation.
"deliver -u user -m mailboxname" could be used to save new mails. Maybe a save + delete would work too. I don't really think it's worth it.
If anyone has any suggestions, I'd really appreciate this.
See the antispam plugin: http://johannes.sipsolutions.net/Projects/dovecot-antispam
Thanks a lot for the answer and suggestions!
Martin
Am 11.07.2010 um 21:01 schrieb Timo Sirainen:
On Sat, 2010-07-10 at 09:14 +0200, Martin Waschbuesch wrote:
1.) Is there any danger regarding maildir consistency in directly moving mail items about?
No. Assuming you use "mv" and not "cp" (and it's all in the same filesystem) so that the move is atomic.
2.) Could I somehow use deliver to move the mails? I think I can recall that other LDAs (maildrop?) allow for that? This would of course be preferred as the maildir cache would also still be optimized after the operation.
"deliver -u user -m mailboxname" could be used to save new mails. Maybe a save + delete would work too. I don't really think it's worth it.
If anyone has any suggestions, I'd really appreciate this.
See the antispam plugin: http://johannes.sipsolutions.net/Projects/dovecot-antispam
-- "If we don't believe in freedom of expression for people we despise, we don't believe in it at all. "
Noam Chomsky
participants (2)
-
Martin Waschbuesch
-
Timo Sirainen