# mark bug as forwarded forwarded 525810 [email protected] thanks Hi Alexandros,
I just received a Debian bug report regarding the avelsieve SquirrelMail
plugin. It is pretty much self-explanatory, so I just forward it. The
change the user suggests sounds sane and I consider it for a new upload
(if I upload 1.9.7 again for whatever reason). I would of course like it
better if you released 1.9.8 including this patch any time soon... :)
Cheers,
Hauke
On Mon, Apr 27, 2009 at 11:22:46AM +0200, Philipp Dreimann wrote:
> 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.
> --- 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.");
> }
signature.asc
Description: Digital signature

