Reputation: 121
i have to change my virtual mail folder tree.
I've configured a new mailserver and now i must import my old virtual mailboxes.
My old one directory was like /var/spool/vmail/domain.com/account/Maildir with inside ( cur / new / ...). I have to move like that /var/spool/vmail/domain.com/account
so i have to do this for every domain. Move all from Maildir to parent folder (the account folder).
I need a script cause there are hundreds of folders.
Thank you so much for any suggestion
Upvotes: 0
Views: 384
Reputation: 200373
Try this:
for f in /var/spool/vmail/*/*; do
mv "$f/Maildir"/* "$f"/
rmdir "$f/Maildir"
done
Upvotes: 1
Reputation: 123608
How about cd /var/spool/vmail/domain.com/account/Maildir; mv * ..
Upvotes: 0