Empty Trash plugin for SquirrelMail
===================================
Ver 2.0, 2011/04/16


Copyright (c) 2004-2011 Paul Lesniewski <paul@squirrelmail.org>
Copyright (c) 2002-2003 Derek Battams <derek@battams.ca>



Description
===========

This plugin automatically empty users' trash folders periodically.
The system administrator can configure the trash to be emptied for
users based on:

   * number of logins
   * number of days since last login

Trash can be emptied either upon login or logout.

There are no options for an individual user to prevent this from
happening.  If you install this plugin, then ALL users will be
subjected to automatic trash deletion.

However, it's also important to note that this plugin ONLY empties
the trash of users who use SquirrelMail.  Users who do not use
SquirrelMail will not be subject to this plugin's functionality
whatsoever.  If you offer other types of access to user email
(e.g., POP, direct IMAP), you'll want to configure your mail server
to maintain user trash folders instead.

You may also want to look at the "Proon Automatic Folder Pruning"
plugin, which offers functionality similar to this plugin (and much
more).  See: http://www.squirrelmail.org/plugin_view.php?id=251

Also note if $empty_upon_login is set to 0 (zero), trash will only
be emptied for users who use the "Sign Out" link (it is common for
users to close their browser instead of signing out).

Finally, note that the default configuration for this plugin will
delete trash once every 30 days at login.



License
=======

This plugin is released under the GNU General Public
License (see the file COPYING for details).



Donations
=========

If you or your company make regular use of this software,
please consider supporting Open Source development by
donating to the authors or inquire about hiring them to
consult on other projects.  Donation/wish list links for
the author(s) are as follows:

Paul Lesniewski: https://squirrelmail.org/donate_paul_lesniewski.php



Requirements
============

  * SquirrelMail version 1.2.2 or above



Troubleshooting
===============

  * If changes to the configuration file don't seem to be having
    any effect, ensure that there are not two Empty Trash
    configuration files, one in the empty_trash directory and
    one in the main SquirrelMail config directory (named
    "config_empty_trash.php").  The one in the main SquirrelMail
    config directory will always override the one in the
    empty_trash directory.



Help Requests
=============

Before looking for help elsewhere, please try to help yourself:

  * Read the Troubleshooting section herein.

  * Look to see if others have already asked about the same issue.
    There are tips and links for the best places to do this in
    the SquirrelMail mailing list posting guidelines:
    http://squirrelmail.org/wiki/MailingListPostingGuidelines
    You should also try Google or some other search engine.

  * If you cannot find any information about your issue, please
    first mail your help request to the squirrelmail-plugins
    mailing list.  Information about it can be found here:
    http://lists.sourceforge.net/mailman/listinfo/squirrelmail-plugins
    You MUST read the mailing list posting guidelines (see above)
    and include as much information about your issue (and your
    system) as possible.  Including configtest output, any debug
    output, the plugin configuration settings you've made and
    anything else you can think of to make it easier to diagnose
    your problem will get you the most useful responses.  Inquiries
    that do not comply with the posting guidelines are liable to
    be ignored.

  * If you don't get any replies on the mailing list, you are
    welcome to send a help request to the authors' personal
    address(es), but please be patient with the mailing list.



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

  v2.0  2011/04/16  Paul Lesniewski <paul@squirrelmail.org>
    * No longer relies on JavaScript to empty the trash folder
    * Added configuration option that specifies that the trash
      folder should be emptied upon logout.
    * Rewrote several pieces of code, fixing efficiency issues
      and old, out-of-date code.
    * Allow configuration file to be stored in main SquirrelMail
      configuration directory if desired.

  v1.4  2005/03/12  Paul Lesniewski <paul@squirrelmail.org>
    * Fix for when user does not use trash folder.

  v1.3  2004/07/27  Paul Lesniewski <paul@squirrelmail.org>
    * Created config file to allow administrative control over
      deletion criteria.  
    * Fixed time-based criteria to measure days instead of weeks
      (which had an inadvertent bug)

  v1.2  2003/07/04  Derek Battams <derek@battams.ca>
    * New setup.php format for faster overall SM performance
    * Updated for SM version reporting API

  v1.1  2002/11/03  Derek Battams <derek@battams.ca>
    * Fixed an include() bug which would cause a duplicate
      function definition error if the SM installation decided
      to use database storage for preferences (thanks to 
      Paul Barton <paul@moonkhan.org> for bringing this bug
      to my attention).
    * Audited the code for SM >= 1.2.8 compatibility.  Based
      on my testing (SM 1.2.9; PHP 4.2.2), the Empty Trash
      plugin should be compatible with SM >= 1.2.8.

  v1.0  2002/04/17  Derek Battams <derek@battams.ca>
    * Initial release

