Program overview

PMMail Archiver works by examining all the files in the specified directory structure and checking the specified parameters against each file.

The following steps are taken during the archive process:

1. Verify all the specified options for validity.

2. For each account specified, or all accounts if none specified:

     a. Read the directory and get list of all folders.

     b. Read each folder and get list of files.

     c. Read the folder.bag file in each folder.

     d. Read each file to get file information.

     e. Check each file against filter criteria. Eliminate files which don't match.

3. Create a list of files which are to be archived.

4. Create a file BACKUP.BAG to contain folder.bag entries for each file being archived. Store full path relative to the PMMail directory.

5. Call InfoZip to archive selected files.

6. If InfoZip was successful and the files are to be deleted:

     a. Rewrite the folder.bag file for each folder, removing those files from the bag file which were archived.

     b. Delete the files in each folder which were archived.

The following steps are taken during the restore process:

1. Verify all the specified options for validity.

2. Verify the zip file exists.

3. Unzip the backup.bag file from the zip file. If it is not there then exit with an error.

4. Read the backup.bag file to get list of files contained in backup.

5. Filter the list of files using the specified parameters.

6. Restore the files. If query mode is active then query the user before restoring each file.