From e8a29cf134f7df1a1e7637083f6d7adf64949b7c Mon Sep 17 00:00:00 2001
From: jmontoya <jmontoya@ispconfig3>
Date: Wed, 04 Aug 2010 12:57:28 -0400
Subject: [PATCH] Adding new functions to the Remoting class

---
 server/plugins-available/maildrop_plugin.inc.php |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/server/plugins-available/maildrop_plugin.inc.php b/server/plugins-available/maildrop_plugin.inc.php
index 8891ead..6296653 100644
--- a/server/plugins-available/maildrop_plugin.inc.php
+++ b/server/plugins-available/maildrop_plugin.inc.php
@@ -166,8 +166,10 @@
 		}
 			
 			// Write the custom mailfilter script, if mailfilter recipe has changed
-			if($data["old"]["custom_mailfilter"] != $data["new"]["custom_mailfilter"] or
-			   $data["old"]["move_junk"] != $data["new"]["move_junk"]) {
+			if($data["old"]["custom_mailfilter"] != $data["new"]["custom_mailfilter"]
+			   or $data["old"]["move_junk"] != $data["new"]["move_junk"]
+			   or $data["old"]["cc"] != $data["new"]["cc"]) {
+			   
 				$app->log("Mailfilter config has been changed",LOGLEVEL_DEBUG);
 				if(trim($data["new"]["custom_mailfilter"]) != '' or $data["new"]["move_junk"] != 'n') {
 					// Delete the old filter recipe
@@ -184,6 +186,11 @@
 					$config_file_path = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.mailfilter';
 					
 					$mailfilter_content = '';
+					
+					if($data["new"]["cc"] != '') {
+						$mailfilter_content .= "cc \"!".$data["new"]["cc"]."\"\n";
+					}
+					
 					if($data["new"]["move_junk"] == 'y') {
 						$mailfilter_content .= file_get_contents($conf["rootpath"].'/conf/mailfilter_move_junk.master')."\n";
 					}
@@ -226,6 +233,10 @@
 			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].'/.mailfilter';
 			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].'/.vacation.lst.gdbm';
+			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].'/.vacation.lst.lock';
+			if(is_file($file)) unlink($file)  or $app->log("Unable to delete file: $file",LOGLEVEL_WARN);
 			rmdir($dir) or $app->log("Unable to delete directory: $dir",LOGLEVEL_WARN);
 		}
 	}

--
Gitblit v1.9.1