<?php
/*******************************************************************************

    Author ......... Jimmy Conner
    Contact ........ jimmy@advcs.org
    Home Site ...... http://www.advcs.org/
    Program ........ Attachment CleanUp
    Version ........ 0.2
    Purpose ........ Deletes any left over temporary files (from attachments)
                     that are over 1 day old

*******************************************************************************/

   REQUIRES : Squirrlemail v1.4.0 or higher


Disclaimer
========
   This plugin is a last resort option, if at all possible, try to use a cron job
   to accomplish this, you can add something like this

   find /somedir -type f -mtime +1 -exec rm -f {} \;

   to accomplish the samething but more effectively in a cron job.
   (Make sure your data_dir and attachment_dir are not the same when using
    the cron job provided)

   But for all us who can't use a cron job to get it done, there is this plugin!

   You MUST give your web server read access to the attachment directory for this
   plugin to work, but it is recommended that you either move this directory outside
   of the web root or stick a "deny all" .htaccess file inside of this directory.

   If you are using the data directory as your attachment directory, it is recommended that
   you backup it up first, before installing this plugin, or you might lose some settings.
   If this plugin, does delete some files, please let me know so I can add them to the array

Features
========

   * Compatible with having the data directory and the attachment
     directory set to the same location (will not delete prefs, ect..)
   * Deletes at login time
   * Randomizes the script, so its someone logging in only has a 1 in 10
     chance of cleanup running, which cuts down the load on the server.


Installation
============

   As with other plugins, just uncompress the archive in the plugins
   directory, go back to the main directory, run configure and add the plugin.
   Questions/comments/flames/etc can be sent to the jimmy@advcs.org


Change Log
============

   0.2
      * Added randization
      * Fixed error when attachment directory didn't exist or wasn't readable by
        web server
      * Added more files to skip (possibly some more, let me know!)
      * Added recommendations that this be done with a cron job if at all possible


   0.1
      * Initial version



