Skip to content

Instantly share code, notes, and snippets.

View mounty1's full-sized avatar

Michael Mounteney mounty1

  • Brisbane
View GitHub Profile
# Copy and convert a Dovecot maildir hierarchy to Cyrus.
# Nothing wrong with Dovecot but my OS (OmniOS) does not maintain it in the package repo.
# Run it in the root of the Dovecot store.
for user in *
do
droot=/var/opt/ooce/cyrus/mail/${user:0:1}/user/${user}/
ls -d ${user}/.[1-z]*/cur | sed -e 's:^'"${user}"'/\.\(.*\)/cur:\1:' | while read D
do
dest="${droot}${D//\./\/}"
echo "<<<${dest}>>>"