From 08cc7f673c377bf88897743e340097e93f1e95f4 Mon Sep 17 00:00:00 2001 From: ftimme <ft@falkotimme.com> Date: Wed, 16 Jan 2013 09:30:05 -0500 Subject: [PATCH] - Changed regex for redirect path (Web sites, subdomains, vhost subdomains, alias domains) and web folder (vhost subdomains) so that ".." is not allowed (in order to prevent path traversals). - nginx: don't allow folders for proxy redirects (subdomains and alias domains); URL is required. - nginx: modified rewriting. --- server/plugins-available/maildrop_plugin.inc.php | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/server/plugins-available/maildrop_plugin.inc.php b/server/plugins-available/maildrop_plugin.inc.php index f35fcd5..085a992 100644 --- a/server/plugins-available/maildrop_plugin.inc.php +++ b/server/plugins-available/maildrop_plugin.inc.php @@ -125,7 +125,7 @@ $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.msg'; if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file",LOGLEVEL_WARN); $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.autoresponder'; - if(is_file($file)) unlink($ar_file) or $app->log("Unable to delete file: $ar_file",LOGLEVEL_WARN); + if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file",LOGLEVEL_WARN); //Now we create the new autoresponder, if it is enabled @@ -211,10 +211,14 @@ unset($config_file_path); } else { // Delete the mailfilter recipe - $email_parts = explode("@",$data["old"]["email"]); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.mailfilter'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file",LOGLEVEL_WARN); - $app->log("Deleting custom Mailfiter".$file,LOGLEVEL_DEBUG); + if(isset($data["old"]["email"])) { + $email_parts = explode("@",$data["old"]["email"]); + $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.mailfilter'; + if(is_file($file)) { + unlink($file) or $app->log("Unable to delete file: $file",LOGLEVEL_WARN); + $app->log("Deleting custom Mailfiter".$file,LOGLEVEL_DEBUG); + } + } } } } -- Gitblit v1.9.1