How to clear mailboxes after backup/restore?

bigbangtech

New member
Joined
Dec 9, 2005
Messages
2
I'm a DA reseller, and am moving my setup, including client domains to a new DA server using backup/restore.

What I'm concerned about is that this also copies the client's user's mailboxes to the new server, and when they go to check email, tons of old emails will flood in.

I can't let this happen, and I also can't just delete/recreate their email addresses to clear out the mailboxes as it will be too inconvenient for the number of users they have.

Is there a PHP script I can use to delete the mailboxes? I've hear that each mailbox would be stored in /var/spool/virtual/domain.tld/user

Is this correct?

Since I can't browse to that location and SSH is not enabled on my server, what can I do to clear the mailboxes?

I tried installing Fileman, but that gets me nowhere as well.

Thanks
 
OK, I was able to solve my issue. I downloaded tar and gzip/unzip from GnuWin32.

I gunzipped the backup.tar.gz, and then was able to use the command line version of tar to remove the pop mailboxes from the tarball using:

tar --delete "backup/domain.tld/email/data/pop/*" -f backup.tar

And then gzipped the tarball and restore it on my server.

Mailboxes all gone! But mail settings kept!

You can also delete specific pop mailboxes by replacing * with the username:

tar --delete "backup/domain.tld/email/data/pop/username" -f backup.tar
 
Back
Top