Courier Vacation plugin for SquirrelMail
========================================
Ver 1.0, 29/04/03

Original author: Paul Lesneiwski <pdontthink@angrynerds.com>


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

This plugin allows your users to set vacation/autoresponder
messages when you use a setup similar to Courier Maildrop 
LDA with a database backend.  Currently, only MySQL backends
are supported, but this plugin can easily be extended to
accomodate other backends.  Email if interested.

Users can turn autoresponse functionality on and off without
losing any of the data they entered.  They may enter a
vacation message, an optional subject, optionally forward
incoming mail to any number of other addresses, and choose
whether or not to keep a copy of incoming mail in their 
account.

This plugin assumes that the paths to your users' home 
directories are found in the backend of your choice (remember
to configure the backend in the config.php file) and that you
have made those directories writable by the user that your web 
server runs as.  For example, a user named "jose" would have
a directory like this:

drwxrwx--x    2 5001     apache       4096 Apr 25 21:20 jose/

For security's sake, those home directories should be separate
from users' mail directories, and should contain no valuable 
files.  A virtual user system might have nothing at all them.

A sample maildroprc file that is needed to make use of the
files created by this plugin is as follows:

#
## MAILDROPRC
#

# test for vacation file, if it exists, send autoresponse
#
`test -f vacation.txt`
if ($RETURNCODE==0)
{


   # test for vacation message subject, use it if found
   #
   `test -f vacation_subject.txt`
   if ($RETURNCODE==0)
   {

      SUBJECT=`cat vacation_subject.txt`
      cc "| mailbot -t vacation.txt -A 'From: $LOGNAME' -A 'Subject: $SUBJECT' /usr/sbin/sendmail -f ''"


   # otherwise, regular "Re:" syntax for subject is automatic
   #
   }
   else
   {

      cc "| mailbot -t vacation.txt -A 'From: $LOGNAME' /usr/sbin/sendmail -f ''"

   }


   # test for any cc addresses, forward to those addresses if present
   #
   `test -f vacation_cc_addresses.txt`
   if ($RETURNCODE==0)
   {

      # grab cc addresses
      #
   `test -f vacation_cc_addresses.txt`
   if ($RETURNCODE==0)
   {

      # grab cc addresses
      #
      CCADDRESSES=`cat vacation_cc_addresses.txt`


      # do we need to keep a copy of messages in this account or not?
      #
      `test -f vacation_keep_messages.txt`
      if ($RETURNCODE==0)
      {
         cc "! -f \"$FROM\" $CCADDRESSES"
      }
      else
      {
         to "! -f \"$FROM\" $CCADDRESSES"
      }


   }

}



Change Log
==========
  1.0 -  Paul Lesneiwski <pdontthink@angrynerds.com>
   * Initial release

