[Dovecot] Move mail in Maildir without IMAP

Timo Sirainen tss at iki.fi
Fri Dec 19 07:52:58 EET 2008

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. 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20081219/6f5cb8da/attachment.bin 

More information about the dovecot mailing list