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

    Author ......... Dominique Leuenberger 
    Contact ........ dominique.leuenberger@gibb.ch
    Home Site ...... http://ressort-informatik.gibb.ch/
    Program ........ vpopmail
    Version ........ 1.00
    Purpose ........ VPOPMail Account Administration

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


--Purpose--

    Allows the user to Administer his account as he'd be able using QMailAdmin.
    Of course, a lot of functions could be implemented using MySQL - Databases.
    And it sortof would even be better for some Security - Aspects.
    BUT: We needed a script that keeps QMailAdmin running.

----[ Features

    Allows the user to:
    - change his Password
    - configure forwards
    - configure away messages
 
    What options to show is configurable in config.php

----[ Installation

    Plugin installs as any other: extract to plugins-folder and activate it in the
    config-file.

    Setup the config.php - Variables of the plugin

    ************* IMPORTANT ************
    For the plugin to work correctly, the Web-Server needs to run as same user
    as vpopmail does (most common: user vpopmail)
    this is because the plugin needs write-permissions to the users Maildir to
    - create appropriate .qmail-files
    - create away - messages

----[ Possible Bugs?

    There probably are bugs left!
    Please let me know... I'll gonna try to fix 'em

----[ Changelog
     --- 1.00 ---
           Extended the plugin for multilang ability
           languages included are:
             - English
             - German
            Translations are welcome and will be packaged to possible future releases
     --- 0.99 ---
           The plugin is now compatible to Version 1.40 of Squirrelmail.
           No testing has been done on 1.2 branch of SM anymore!
     --- 0.98 ---
           *** UPDATE URGENTLY RECOMENDED ***
             Fixed a remote exploit which allowed the users to do some 
             bad stuff with your vpopmail installation
           *** UPDATE URGENTLY RECOMENDED ***

           Different users reported when running squirrelmail with vpopmail hosting
           only a singledomain, the vpopmail-plugin would not be able to change
           passwords. All other functions would be nonfunctional as well.
           While analyzing we found the user only logs in using <user> and not 
           <user@domain>. As VPopmail inetrnal identifies all users by their
           complete E-Mail-Address, this error occoured.
           --> FIX
               There's now a new option in config.php: $vpopmail_defaultdomain
               Just set it to whatever domain your users should be on.
               Whenever a user logs in with complete <user@domain>, the config
               option will be overridden. For the other case, 
               $vpopmail_defaultdomain will be used.
     --- 0.97 ---
           Code has been reviewd for the plugin to work with register_globals = off
           as this has been requested by some users.
           no other new features had been added
     --- 0.96 ---
           Security Fix
           - Directory for messages has been created with to much rights.
             Thanks to Nico
     --- 0.95 ---
           Ability to choose options a user will see:
            - Password Dialog
            - Away Messages
            - Forwards
           Status Messages after changing pass / configuring away or forwards
     --- 0.9 ---
           First public release
           Options this far: - Allows user to change his pass
                             - Creation of forwards
                             - Configuration of away - messages
           
