SF.net SVN: postfixadmin:[650] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2009-05-03 17:23:57
|
Revision: 650 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=650&view=rev Author: christian_boltz Date: 2009-05-03 17:23:48 +0000 (Sun, 03 May 2009) Log Message: ----------- functions.inc.php: - gen_show_status(): add support for recipient_delimiter when checking aliases This implements part (8) of https://sourceforge.net/tracker/?func=detail&aid=1951926&group_id=191583&atid=937967 config.inc.php: - add new setting $CONF['recipient_delimiter'] Modified Paths: -------------- trunk/config.inc.php trunk/functions.inc.php Modified: trunk/config.inc.php =================================================================== --- trunk/config.inc.php 2009-05-03 16:14:14 UTC (rev 649) +++ trunk/config.inc.php 2009-05-03 17:23:48 UTC (rev 650) @@ -301,6 +301,10 @@ // - add the corresponding color to show_custom_colors $CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext"); $CONF['show_custom_colors']=array("lightgreen","lightblue"); +// If you use a recipient_delimiter in your postfix config, you can also honor it when aliases are checked. +// Example: $CONF['recipient_delimiter'] = "+"; +// Set to "" to disable this check. +$CONF['recipient_delimiter'] = ""; // Optional: Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2009-05-03 16:14:14 UTC (rev 649) +++ trunk/functions.inc.php 2009-05-03 17:23:48 UTC (rev 650) @@ -2140,7 +2140,13 @@ while ( ($g=array_pop($gotos)) && $stat_ok ) { $stat_catchall = substr($g,strpos($g,"@")); - $stat_result = db_query ("SELECT address FROM $table_alias WHERE address = '$g' OR address = '$stat_catchall'"); + $stat_delimiter = ""; + if (!empty($CONF['recipient_delimiter'])) { + $delimiter = preg_quote($CONF['recipient_delimiter'], "/"); + $stat_delimiter = preg_replace('/' .$delimiter. '[^' .$delimiter. ']*@/', "@", $g); + $stat_delimiter = "OR address = '$stat_delimiter'"; + } + $stat_result = db_query ("SELECT address FROM $table_alias WHERE address = '$g' OR address = '$stat_catchall' $stat_delimiter"); if ($stat_result['rows'] == 0) { $stat_ok = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |