From: <jgs...@us...> - 2003-12-09 19:34:22
|
Update of /cvsroot/serverfilters In directory sc8-pr-cvs1:/tmp/cvs-serv1550 Modified Files: README backend.php functions.php package Added Files: virtualdomains.sample Log Message: Made changes to make plugin more independent of virtual domain/ mail server configurations. Index: README =================================================================== RCS file: /cvsroot/serverfilters/README,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** README 9 Dec 2003 06:50:12 -0000 1.3 --- README 9 Dec 2003 19:34:17 -0000 1.4 *************** *** 20,25 **** Compatibility plugin Maildrop or procmail - ftp support in php if using ftp backend - libmcrypt support if mcrypt is used for encryption INSTALLATION --- 20,23 ---- *************** *** 32,35 **** --- 30,53 ---- 4) reconfigure SquirrelMail to enable the ServerSideFilter plugin. + + 5) If your webserver runs as a user OTHER than apache: + chown root:webuser script/filtercmd + where webuser is the user that Apache runs as. + + Virtual Domain users: + 6) If you use qmail: + ln -s /var/qmail/control/virtualdomains . + + If you use another mail server: + cp ./virtualdomains.sample ./virtualdomains + + edit the virtualdomains file. + The format is: + domain:domain_user + + Where domain is the domain of each of your virtual domains + and domain_user is the unix name of the user that owns the + directory containing the mail folders for that domain. + Index: backend.php =================================================================== RCS file: /cvsroot/serverfilters/backend.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** backend.php 9 Dec 2003 06:50:12 -0000 1.3 --- backend.php 9 Dec 2003 19:34:17 -0000 1.4 *************** *** 199,223 **** } - function qmail_virtual_domain_user($domain){ - $control = '/var/qmail/control'; - $vfile = "$control/virtualdomains"; - if (!file_exists($vfile) || !is_readable($vfile)){ - return false; - } - $fd = fopen($vfile, 'r'); - $contents = fread($fd, filesize($vfile)); - $contents = rtrim($contents); - if (strlen($contents) > 0){ - $domuary = explode("\n", $contents); - foreach ($domuary as $domu){ - list($dom,$user) = split(':', $domu); - if ($dom == $domain) break; - } - if ($dom == $domain) return $user; - else return false; - } else { - return false; - } - } - ?> --- 199,201 ---- Index: functions.php =================================================================== RCS file: /cvsroot/serverfilters/functions.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions.php 9 Dec 2003 18:45:47 -0000 1.3 --- functions.php 9 Dec 2003 19:34:17 -0000 1.4 *************** *** 137,142 **** // get the owner of a virtual domain function my_virtual_domain_user($domain) { ! $vd_user = 'qmail_virtual_domain_user'; ! return $vd_user($domain); } --- 137,158 ---- // get the owner of a virtual domain function my_virtual_domain_user($domain) { ! $vfile = "../plugins/serversidefilter/virtualdomains"; ! if (!file_exists($vfile) || !is_readable($vfile)){ ! return false; ! } ! $fd = fopen($vfile, 'r'); ! $contents = fread($fd, filesize($vfile)); ! $contents = rtrim($contents); ! if (strlen($contents) > 0){ ! $domuary = explode("\n", $contents); ! foreach ($domuary as $domu){ ! list($dom,$user) = split(':', $domu); ! if ($dom == $domain) break; ! } ! if ($dom == $domain) return $user; ! else return false; ! } else { ! return false; ! } } Index: package =================================================================== RCS file: /cvsroot/serverfilters/package,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** package 9 Dec 2003 19:01:27 -0000 1.4 --- package 9 Dec 2003 19:34:17 -0000 1.5 *************** *** 19,23 **** cp config.php serversidefilter/config.php.sample ! cp setup.php options.php functions.php backend.php ChangeLog index.php README recipie_functions.php version serversidefilter/ cp images/*.gif serversidefilter/images cp script/filtercmd.c serversidefilter/script/ --- 19,23 ---- cp config.php serversidefilter/config.php.sample ! cp setup.php options.php functions.php backend.php ChangeLog index.php README virtauldomains.sample recipie_functions.php version serversidefilter/ cp images/*.gif serversidefilter/images cp script/filtercmd.c serversidefilter/script/ |