Vacation plugin v0.2 for QMAIL with LDAP directory
--------------------------------------------------

This plugin allows you to set an auto-reply message to incoming email.
Most commenly used to notify the sender of one's absence.
The vacation message is store in the LDAP directory.

It is written for the QMAIL server with authentication on an LDAP server.
You can find the QMAIL program at the following URL: http://cr.yp.to/qmail.html
OpenLDAP can be found at http://www.openldap.org/
Note that you have to apply a patch to qmail so that the autentication could
have done.
For this, take down the patch here: http://www.nrg4u.com/qmail/ and
don't forget to copy the qmail.schema generated file to the LDAP's schemas
directory.

For my configuration, i use openldap-servers-2.0.23-4 with qmail-1.03
and the patch qmail-ldap-1.03-20011001a.patch

The vacation messages are stored in the LDAP sevrer under the "mailReplyText"
field of the user's dn, and is activated if the "deliveryMode" is set to "reply".
Only the first vacation message stored in the LDAP directory is used for the moment.


It is released under the GPL.

Configuration
-------------
You should edit (at least) the config.php file to reflect the settings of your
site. 
You have two ways to update the user LDAP vacation message:
- if users don't have access to change their password in the LDAP directory, uncomment
  the manager parameter
- if users have access to change their password, you don't have to change
  anything about login parameter.
  To allow users to change their settings, you could put the followin acl
  in the slapd.conf configuration file:
  access to attrs=mailReplyText,deliveryMode
	by self write
	by * auth

Problems
--------
Question: 
1) What mean the following message:
   > Warning: LDAP: Unable to perform the search: No such object in
   > /usr/share/squirrelmail/plugins/vacation/options.php on line 43
  Answer: The search engine is not correct. Does the "cn" is as
    $cn="uid=$username,ou=Users,dc=idealx,dc=com";
    or $cn="cn=$username,ou=Users,dc=idealx,dc=com"; ?

Version
-------
0.1
   First release
0.2 (20030502)
   update for compatibility with Squirrelmail 1.4.0
0.3 (20050714) by Silver Salonen <silver@ultrasoft.ee>
   detailed changes:
      overall:
	* add support for internalization, only et_EE now
	* compatible with "register_globals = off"

      config.php:
	* $ldap_port from string to int
	* fixed a few grammar mistakes in comments
	* added options:
	** $ldap_protocol
	** $ldap_mail_field
	** $ldap_replymessage_field
	** $ldap_replyflag_field
	** $ldap_replyflag_reply
	** $ldap_replyflag_normal
	** $ldap_query_filter
	** $use_subject_field
	** $base64encode_message

      options.php and update.php:
	* commented out session_start()
	* get from Squirrelmail's globals for getting password automatically, before including config.php: $username, $key, $onetimepad
	* after connecting and before binding to LDAP-server, set LDAP-protocol to $ldap_protocol
	* use $ldap_query_filter when searching for an entry from LDAP
	* if $base64encode_message is true, message is base64 encoded before entering it to LDAP and decoded after getting it from LDAP

      options.php:
	* fixed some HTML-layout mistakes
	* added field for setting subject (must be in LDAP as "%%%${subject}%%%"). not shown if setting $use_subject_field is set to false
	* connection was made to "localhost", not $ldap_server - fixed that
	* querying $ldap_replymessage_field as vacation-message
	* querying $ldap_replyflag_field as delivery mode
	* choose activation of auto-reply with checkbox, not select
	* use htmlentities() for echoing $subject and $vacation on page
	* change error-message of connecting to LDAP to english

      update.php:
	* show a little summary
	* added link for getting to options.php
	* $newinfo -> $modifyAttributes
	* when attribute that is supposed to get modified is empty, it's deleted instead

      setup.php:
	* plugin name and description set into Squirrelmail's options' array, so that it would appear within other modules, not separately.

Author
------
Jrme Tournier <jtournier@IDEALX.com>
