(This option is only available in VPOP3 Enterprise)
First - if the problem is that messages were deleted very recently (the default is within 3 days), you can probably use the Undelete feature in VPOP3.
If the messages were deleted longer ago than that, you can use the partial restore facility in VPOP3 version 5 or later.
Note that you do not need to stop VPOP3 to do this
First you need to find the appropriate database backup file. Usually VPOP3 makes daily database backups on a weekly cycle into the main VPOP3 installation directory, called DBBACK-n.DMP. You may have configured the settings to store these backups elsewhere or do them in a different cycle, but we will assume the defaults. Choose the appropriate backup file which will contain the messages you want to restore.
Now, you need to restore this database file into a temporary PostgreSQL database. For the purposes of this article, we will assume you will be restoring to the same database server as your main VPOP3 database, but to a database called vpop3temp. You could restore to a different PostgreSQL server on a different PC if you wish, and know how, but that is outside the scope of this article.
To restore the database, you would open a command prompt, then go to the VPOP3 installation folder. Then, go to the pgsql\bin subfolder
e.g. cd \vpop3\pgsql\bin
Then, you would need to create the temporary database
e.g. createdb -U postgres -p 5433 -T template0 -E SQL_ASCII vpop3temp
(the default password is pgsqlpass
)
Now, you need to restore the database backup to the temporary database
e.g. pg_restore -U postgres -p 5433 -d vpop3temp -j 4 -v DBBACK-n.TMP
(the default password is pgsqlpass
)
Now, go to the VPOP3 settings, and go to Settings → Database → Restore
localhost
postgres
pgsqlpass
5433
vpop3temp
from the Database drop-downNow, choose the appropriate mailboxes/folders from the table. You can choose where to restore the messages - into the original user's mailbox, or a specified user, and if you want to restore the folders to the original folder or a specified folder.
You can also choose whether you want the restored messages to be marked unread, 'flagged' (or 'starred', or however your email client displays the IMAP 'FLAGGED' attribute), or with the original attributes.
Press Start Restore to start the restore process - note that this may take a while if there are lots of messages to be restored.
Once the messages have been restored, you may want to drop the temporary database to free up disk space. To do this, use the command:
e.g. dropdb -U postgres -p 5433 vpop3temp
(default password is pgsqlpass
)
You can use this procedure to restore from v3 or v4 of VPOP3, but any messages over 100kB will not be restored because they are not stored in the database in the older versions of VPOP3.