Question

I have successfully changed my mail imap agent from dovecot to courier-imap, for some required features, how ever i am facing a problem during the maildrop/seive directory structure where i need to move 10000 mailboxes to correct directory structure,

so what i need is a script that will convert to move like this

mv /var/vmail/[ domain ]/[ username ]/Maildir/* /var/vmail/[ domain ]/[ username ]/

and i dont want to run this command 10000 times, its troublesome, could you help with this,

thank you

Was it helpful?

Solution

for dir in /var/vmail/*/*
do
  mv "$dir"/Mail/* "$dir"
done
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top