|
From: Tyler A. <fi...@us...> - 2001-02-22 13:24:49
|
Update of /cvsroot/squirrelmail/squirrelmail/plugins/mail_fwd
In directory usw-pr-cvs1:/tmp/cvs-serv26402/mail_fwd
Added Files:
Tag: sm-1_0
README install setup.php
Log Message:
* Added all the plugins to the 1.0 branch. Hope that this is still the
correct thing to do -- don't want to make people mad.
* Will add them to the 1.1 branch shortly.
* Are we going to make a new policy for plugin people to include their
plugin in the CVS for whatever SquirrelMail versions the plugin works
with? Just the newest stable branch and the experimental branch?
* If these should NOT be here, let me know and I'll remove all plugins from
1.0 and the soon-to-have-them 1.1 branches.
--- NEW FILE ---
Email Forwarding plugin for SquirrelMail
----------------------------------------
Ritchie Low <rl...@xi...>
Ver 0.1, Jan 2001
The Options for Email forwarding is 'plugged'
into the Personal Options page.
You must copy the wfwd program to /usr/sbin as
this is the program the setup script calls
when you save the options.
You can change the location but you must then
modify the setup script as well.
--- NEW FILE ---
Installing Plugins
==================
Simply untar the file in the plugins directory, and make sure it is
in its own directory, and that the name of the directory is the name
of the plugin. Example below uses "plug_demo" as the name of the
plugin:
$ cd plugins
$ tar -zxvf /usr/archives/plug_demo.tar.gz
Then go to your config directory and run conf.pl. Choose option
8 and add the plugin. Save and exit, then that should be all
if the plugin was made correctly. :)
$ cd ../config
$ ./conf.pl
--- NEW FILE ---
<?php
/***
Email Forwarding plugin for SquirrelMail
----------------------------------------
Ritchie Low <rl...@xi...>
Ver 0.1, Jan 2001
***/
function squirrelmail_plugin_init_mail_fwd() {
global $squirrelmail_plugin_hooks;
global $mailbox, $imap_stream, $imapConnection;
$squirrelmail_plugin_hooks["options_personal_save"]["mail_fwd"] = "mail_fwd_save_pref";
$squirrelmail_plugin_hooks["loading_prefs"]["mail_fwd"] = "mail_fwd_load_pref";
$squirrelmail_plugin_hooks["options_personal_inside"]["mail_fwd"] = "mail_fwd_inside";
}
function mail_fwd_inside() {
global $username,$data_dir;
global $mailfwd_user;
global $color;
?>
<tr>
<td align=right>Forward Emails To:</td>
<td><input type=text name=mfwd_user value="<?php echo "$mailfwd_user" ?>" size=30></td>
</tr>
<?php
}
function mail_fwd_load_pref() {
global $username,$data_dir;
global $mailfwd_user;
$mailfwd_user = getPref($data_dir,$username,"mailfwd_user");
}
function mail_fwd_save_pref() {
global $username,$data_dir;
global $mfwd_user;
if (isset($mfwd_user)) {
setPref($data_dir,$username,"mailfwd_user",$mfwd_user);
} else {
setPref($data_dir,$username,"mailfwd_user","");
}
exec("/usr/sbin/wfwd ".$username." ".$mfwd_user);
}
?>
|