Also forgot to mention that you need to preserve permissions. I had downloaded the dir to my computer and uploaded to the original directory. This overwrote the permissions. So it is better to copy/rsync it from the server itself to preserve all the unique permissions on each folder.
For example
find /usr/local/surgemail/archive_deleted/$domainname | grep -r "$username"
rsync -av --delete-during --progress --stats /usr/local/surgemail/archive_deleted/domain.name.com/ra/gd/username/ /var/surgemail/domain.name.com/ra/gd/username
I'm thinking of making a script that will ask you for the account name, domain name and just run something like
1) Enter username
2) Enter domain name
3) Do you want to recover the $username mailbox from $archive_location (/usr/local/surgemail/archive_deleted/domain.name.com/ra/gd/username/) ? Y/N
Would be cool if it already came included with Surgemail :)
From: "Surgemail Support" <surgemailHIDDEN@t@netwinsite.com>
To: surgemailHIDDEN@etwinsite.com
Sent: Sunday, August 9, 2015 5:55:00 PM
Subject: Re: [SurgeMail List] Restoring a Mailboc
Any chance of automating this in the future in the UI?
We may do.
ChrisP.
On 8/8/2015 2:18 AM, Steven
wrote:
Ok so I've been removing old accounts and I do have
archive_deleted enabled so the accounts are still
there. I've just never needed to recover any before.
A grep later I found the subdirectory that has the
account (why you guys use all these random lettered
directories I'll never know).
Yeah I hate those too, but It's fairly critical for
performance on some file systems and it's easier if it's
always used even when not critical.
I cannot find any documentation on the website for
how to physically recover this account from
archive_deleted folder.
Anyone willing to help? Would I just create the new
account, find the new dirs and copy the data in?
Yes, that's it.
ChrisP.