Shrinking / deleting VPOP3 message archive

> Hi I have few sites where the archive has grown huge over a number of years
> and the customers have asked us to both stop archiving and shrink the db Is
> there any script that can be run to remove the archive or is it a case of
> create a new vpop installation and try to recreate the settings required? 

If they want to stop archiving, they should check any requirements that might apply - eg corporate social responsibility or ability to recover emails if there are allegations of harassment in the workplace. Generally £40 for a 1TB USB hard drive is cheaper than legal fees :-)

The archive has two parts:
- the message storage. This can get huge but can be on an external drive, network share, etc, but most people just leave it in the default location in the VPOP3 directory. It's easy to move it if desired.
- the index database. This is much smaller than the message store, but has to be in the VPOP3 installation directory tree. This is used when people search the archive, to make the searches quicker.

There are a few things you can do:
- You could just delete the archive message store (eg delete the VPOP3\_archive folder and subfolders, if that's where the message store is). That'll delete everything.
- You could change the archive message store to be on a cheap USB external drive by changing the 'Main Store' location in the archive settings.
- You could use the 'Offline Archive' function to have VPOP3 move old messages into a ZIP file which you can put somewhere safe (or delete if you really wish).

If you use the first of these, then you may want to delete the archive index database as well, but it's generally not that big - for instance, here, our archive message store is 105GB, but the index database is only about 3GB.

You can tell how big the archive index database is by using the procedure in this article, and looking for table names beginning with 'archive.': https://wiki.pscs.co.uk/how_to:database_size

To delete the index database totally, you need to stop VPOP3, run 'psql' from a command prompt in the VPOP3 installation directory (default password 'vpop3pass') and type 'drop schema archive cascade;'. After it completes, restart VPOP3 and it will recreate a blank index database.