[Dovecot] Move mail in Maildir without IMAP
I set-up some spam/ham learning folders where a crontab entry learns the mail and them moves it do a different Maildir folder. Unfortunately, since it has a different dovecot-keywords file, any imap flags get changed to unknown-0, unknown-1 etc.
I tried the following, but it didn't work
mv "${src_ham}"/cur/* "$dest_ham"/new/ cp "${src_ham}"/dovecot-keywords "${dest_ham}"
Is there a simple way to do this correctly without going through IMAP?
And are there any more serious consequences of moving mail like this, with dovecot imap running on top.
On Fri, 2008-12-19 at 01:11 +0000, RW wrote:
I set-up some spam/ham learning folders where a crontab entry learns the mail and them moves it do a different Maildir folder. Unfortunately, since it has a different dovecot-keywords file, any imap flags get changed to unknown-0, unknown-1 etc.
I tried the following, but it didn't work
mv "${src_ham}"/cur/* "$dest_ham"/new/ cp "${src_ham}"/dovecot-keywords "${dest_ham}"
Is there a simple way to do this correctly without going through IMAP?
No. But you could do something like:
export MAIL=maildir:/home/user/Maildir printf "1 select src\n2 copy 1:* dest\n3 store 1:* +flags.silent \\deleted\n4 close\n" | imap
And are there any more serious consequences of moving mail like this, with dovecot imap running on top.
No.
On Fri, 19 Dec 2008 07:52:58 +0200 Timo Sirainen tss@iki.fi wrote:
No. But you could do something like:
export MAIL=maildir:/home/user/Maildir printf "1 select src\n2 copy 1:* dest\n3 store 1:* +flags.silent \\deleted\n4 close\n" | imap
That's easier than I thought. Is it possible to do that with virtual accounts, if I set the appropriate uid and path in MAIL, or do I need to give dovecot some additional user information?
On Sat, 2008-12-20 at 12:37 +0000, RW wrote:
On Fri, 19 Dec 2008 07:52:58 +0200 Timo Sirainen tss@iki.fi wrote:
No. But you could do something like:
export MAIL=maildir:/home/user/Maildir printf "1 select src\n2 copy 1:* dest\n3 store 1:* +flags.silent \\deleted\n4 close\n" | imap
That's easier than I thought. Is it possible to do that with virtual accounts, if I set the appropriate uid and path in MAIL, or do I need to give dovecot some additional user information?
Those should be enough. Perhaps also set USER just in case. Also if you're using some plugins they're not enabled when running like this (but with extra environment settings you could run them too).
participants (2)
-
RW
-
Timo Sirainen