Package: avelsieve
Version: 1.9.7-6
Severity: normal

In line 297 of avelsieve/include/sieve_actions.inc.php is the following
regexp to match a valid forward destionation address:
[a-za-z0-9]+[a-za-z0-9\._...@[a-za-z0-9_-]+[a-za-z0-9\._-]+

Beside the fact that it would be better readable if the caseinsensitive
feature of preg_match in line 299 could be turned like this:

if(!preg_match("/^$onemailregex(,$onemailregex)*$/i" , $val['redirectemail'])){

..it also lacks support for emailaddresses with a "+" in the user part.

Here is a patch which works for me.

-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-xen-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages avelsieve depends on:
ii  debconf                       1.5.24     Debian configuration management sy
ii  squirrelmail                  2:1.4.15-4 Webmail for nuts

avelsieve recommends no packages.

Versions of packages avelsieve suggests:
pn  cyrus-imapd-2.2               <none>     (no description available)

-- debconf information:
  avelsieve/no_purge:
* avelsieve/runconfig: true
--- sieve_actions.inc.php.old	2009-04-27 11:17:04.000000000 +0200
+++ sieve_actions.inc.php	2009-04-27 11:03:02.000000000 +0200
@@ -294,9 +294,9 @@
 	}
 
 	function validate($val, &$errormsg) {
-		$onemailregex = "[a-za-z0-9]+[a-za-z0-9\._...@[a-za-z0-9_-]+[a-za-z0-9\._-]+";
+		$onemailregex = "[a-z0-9]+[a-z0-9\._\+...@[a-z0-9_-]+[a-z0-9\._-]+";
 		
-		if(!preg_match("/^$onemailregex(,$onemailregex)*$/" ,	$val['redirectemail'])){
+		if(!preg_match("/^$onemailregex(,$onemailregex)*$/i" ,	$val['redirectemail'])){
 		// if(!preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\._-] +)+$/" ,
 				$errormsg[] = _("Incorrect email address(es). You must enter one or more valid email addresses, separated by comma.");
 		}

Reply via email to