[Dovecot] Put existing mails (in Maildir) through sieve filter?

mouss mouss at netoyen.net
Fri Feb 22 21:22:48 EET 2008


Raphael Bittencourt S. Costa wrote:
> Andreas,
>
> You can write a shell script to do this for you.
>
> cd ~/Maildir/cur
>
> for i in *; do /usr/local/libexec/dovecot/deliver  -d user < $i; rm -f
> $i; echo "Message $i"; done
>   

it would be safer to move the messages to another directory before 
running the loop, and moving the delivrered ones to another dir instead 
of deleting them.

cd ~/Maildir
mkdir todo
mkdir done
cp cur/* todo
for  i  in todo/*; do
    echo "Delivering message $i ..."
    /path/to/deliver -d user < $i && mv $i done/
done



 


More information about the dovecot mailing list