gunnar: server/php-kolab/Kolab_Filter/Filter Content.php, 1.5, 1.6 Filter.php, 1.5, 1.6 Incoming.php, 1.8, 1.9 Outlook.php, 1.4, 1.5

cvs at kolab.org cvs at kolab.org
Mon Feb 11 18:34:46 CET 2008


Author: gunnar

Update of /kolabrepository/server/php-kolab/Kolab_Filter/Filter
In directory doto:/tmp/cvs-serv2706/php-kolab/Kolab_Filter/Filter

Modified Files:
	Content.php Filter.php Incoming.php Outlook.php 
Log Message:
kolab/issue2467 (Koab Filter ignores configuration in 2.2 RC1)

Index: Content.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/Filter/Content.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Content.php	11 Feb 2008 16:46:51 -0000	1.5
+++ Content.php	11 Feb 2008 17:34:43 -0000	1.6
@@ -52,19 +52,19 @@
     {
         global $conf;
 
-        if (!empty($conf['filter']['verify_from_header'])) {
+        if (isset($conf['filter']['verify_from_header'])) {
             $verify_from_header = $conf['filter']['verify_from_header'];
         } else {
             $verify_from_header = true;
         }
 
-        if (!empty($conf['filter']['allow_sender_header'])) {
+        if (isset($conf['filter']['allow_sender_header'])) {
             $allow_sender_header = $conf['filter']['allow_sender_header'];
         } else {
             $allow_sender_header = true;
         }
 
-        if (!empty($conf['filter']['allow_outlook_ical_forward'])) {
+        if (isset($conf['filter']['allow_outlook_ical_forward'])) {
             $allow_outlook_ical_forward = $conf['filter']['allow_outlook_ical_forward'];
         } else {
             $allow_outlook_ical_forward = true;
@@ -99,7 +99,7 @@
                         /* Rewrite from */
                         if (strpos($from, $rc) === false) {
                             Horde::logMessage(sprintf(_("Rewriting '%s' to '%s'"),
-                                                      $from, $to), 
+                                                      $from, $rc), 
                                               __FILE__, __LINE__, PEAR_LOG_DEBUG);
                             $rewrittenfrom = "From: $rc\r\n";
                         }
@@ -191,12 +191,12 @@
     {
         global $conf;
 
-        if (!empty($conf['filter']['smtp_host'])) {
+        if (isset($conf['filter']['smtp_host'])) {
             $host = $conf['filter']['smtp_host'];
         } else {
             $host = 'localhost';
         }
-        if (!empty($conf['filter']['smtp_port'])) {
+        if (isset($conf['filter']['smtp_port'])) {
             $port = $conf['filter']['smtp_port'];
         } else {
             $port = 10025;
@@ -270,13 +270,13 @@
 {
     global $conf;
 
-    if (!empty($conf['filter']['verify_subdomains'])) {
+    if (isset($conf['filter']['verify_subdomains'])) {
         $verify_subdomains = $conf['filter']['verify_subdomains'];
     } else {
         $verify_subdomains = true;
     }
 
-    if (!empty($conf['filter']['email_domain'])) {
+    if (isset($conf['filter']['email_domain'])) {
         $email_domain = $conf['filter']['email_domain'];
     } else {
         $email_domain = 'localhost';
@@ -375,13 +375,13 @@
     global $conf;
 
     if ($sasluser) {
-        if (!empty($conf['filter']['untrusted_subject_insert'])) {
+        if (isset($conf['filter']['untrusted_subject_insert'])) {
             $fmt = $conf['filter']['untrusted_subject_insert'];
         } else {
             $fmt = _("(UNTRUSTED, sender is <%s>)");
         }
     } else {
-        if (!empty($conf['filter']['unauthenticated_subject_insert'])) {
+        if (isset($conf['filter']['unauthenticated_subject_insert'])) {
             $fmt = $conf['filter']['unauthenticated_subject_insert'];
         } else {
             $fmt = _("(UNTRUSTED, sender <%s> is not authenticated)");
@@ -424,7 +424,7 @@
 
     global $conf;
 
-    if (!empty($conf['filter']['email_domain'])) {
+    if (isset($conf['filter']['email_domain'])) {
         $domains = $conf['filter']['email_domain'];
     } else {
         $domains = 'localhost';
@@ -434,25 +434,25 @@
         $domains = array($domains);
     }
   
-    if (!empty($conf['filter']['local_addr'])) {
+    if (isset($conf['filter']['local_addr'])) {
         $local_addr = $conf['filter']['local_addr'];
     } else {
         $local_addr = '127.0.0.1';
     }
 
-    if (!empty($conf['filter']['verify_subdomains'])) {
+    if (isset($conf['filter']['verify_subdomains'])) {
         $verify_subdomains = $conf['filter']['verify_subdomains'];
     } else {
         $verify_subdomains = true;
     }
 
-    if (!empty($conf['filter']['reject_forged_from_headers'])) {
-        $reject_forged_from_headers = $conf['filter']['reject_forged_from_headers'];
+    if (isset($conf['filter']['reject_forged_from_header'])) {
+        $reject_forged_from_header = $conf['filter']['reject_forged_from_header'];
     } else {
-        $reject_forged_from_headers = true;
+        $reject_forged_from_header = true;
     }
 
-    if (!empty($conf['filter']['kolabhosts'])) {
+    if (isset($conf['filter']['kolabhosts'])) {
         $kolabhosts = $conf['filter']['kolabhosts'];
     } else {
         $kolabhosts = 'localhost';
@@ -499,6 +499,7 @@
     foreach ($adrs as $adr) {
         $from = $adr->mailbox . '@' . $adr->host;
         $fromdom = $adr->host;
+
         if ($sasluser) {
             if (!in_array(strtolower($from), $allowed_addrs)) {
                 Horde::logMessage(sprintf(_("%s is not an allowed From address for %s"), 
@@ -510,7 +511,7 @@
                 if (strtolower($fromdom) == $domain 
                     || ($verify_subdomains
                         && substr($fromdom, -strlen($domain)-1) == ".$domain")) {
-                    if ($reject_forged_from_headers) {
+                    if ($reject_forged_from_header) {
                         Horde::logMessage(sprintf(_("%s is not an allowed From address for unauthenticated users."), 
                                                   $from), __FILE__, __LINE__, PEAR_LOG_DEBUG);
                         return false;

Index: Filter.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/Filter/Filter.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Filter.php	28 Nov 2007 15:36:59 -0000	1.5
+++ Filter.php	11 Feb 2008 17:34:43 -0000	1.6
@@ -92,7 +92,7 @@
         ini_set('track_errors', '1');
 
         /* Setup error logging */
-        if (!empty($conf['filter']['error_log'])) {
+        if (isset($conf['filter']['error_log'])) {
             ini_set('log_errors', '1');
             ini_set('error_log', $conf['filter']['error_log']);
         }
@@ -107,7 +107,7 @@
 
         $this->_startts = $this->_microtime_float();
 
-        if (!empty($conf['filter']['tempdir'])) {
+        if (isset($conf['filter']['tempdir'])) {
             $this->_tmpdir = $conf['filter']['tempdir'];
         } else {
             $this->_tmpdir = sys_get_temp_dir();
@@ -120,7 +120,7 @@
         /* This is used as the default domain for unqualified adresses */
         global $_SERVER;
         if (!array_key_exists('SERVER_NAME', $_SERVER)) {
-            if (!empty($conf['filter']['email_domain'])) {
+            if (isset($conf['filter']['email_domain'])) {
                 $_SERVER['SERVER_NAME'] = $conf['filter']['email_domain'];
             } else {
                 $_SERVER['SERVER_NAME'] = 'localhost';
@@ -128,7 +128,7 @@
         }
         
         if (!array_key_exists('REMOTE_ADDR', $_SERVER)) {
-            if (!empty($conf['filter']['server'])) {
+            if (isset($conf['filter']['server'])) {
                 $_SERVER['REMOTE_ADDR'] = $conf['filter']['server'];
             } else {
                 $_SERVER['REMOTE_ADDR'] = 'localhost';
@@ -136,7 +136,7 @@
         }
         
         if (!array_key_exists('REMOTE_HOST', $_SERVER)) {
-            if (!empty($conf['filter']['server'])) {
+            if (isset($conf['filter']['server'])) {
                 $_SERVER['REMOTE_HOST'] = $conf['filter']['server'];
             } else {
                 $_SERVER['REMOTE_HOST'] = 'localhost';
@@ -255,15 +255,15 @@
         }
         $this->_recipients = $recipients;
 
-        if (!empty($options['c'])) {
+        if (isset($options['c'])) {
             $this->_client_address = $options['c'];
         }
         
-        if (!empty($options['h'])) {
+        if (isset($options['h'])) {
             $this->_fqhostname = strtolower($options['h']);
         }
         
-        if (!empty($options['u'])) {
+        if (isset($options['u'])) {
             $this->_sasl_username = strtolower($options['u']);
         }
     }

Index: Incoming.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/Filter/Incoming.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Incoming.php	7 Dec 2007 18:49:21 -0000	1.8
+++ Incoming.php	11 Feb 2008 17:34:43 -0000	1.9
@@ -159,12 +159,12 @@
     {
         global $conf;
 
-        if (!empty($conf['filter']['lmtp_host'])) {
+        if (isset($conf['filter']['lmtp_host'])) {
             $host = $conf['filter']['lmtp_host'];
         } else {
             $host = 'localhost';
         }
-        if (!empty($conf['filter']['lmtp_port'])) {
+        if (isset($conf['filter']['lmtp_port'])) {
             $port = $conf['filter']['lmtp_port'];
         } else {
             $port = 2003;

Index: Outlook.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/Filter/Outlook.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Outlook.php	28 Nov 2007 06:06:12 -0000	1.4
+++ Outlook.php	11 Feb 2008 17:34:43 -0000	1.5
@@ -91,7 +91,7 @@
 {
     global $conf;
 
-    if (!empty($conf['filter']['email_domain'])) {
+    if (isset($conf['filter']['email_domain'])) {
         $email_domain = $conf['filter']['email_domain'];
     } else {
         $email_domain = 'localhost';





More information about the commits mailing list