diff --git a/config.inc.php b/config.inc.php index 2bbca1e1..c7c1f6b5 100644 --- a/config.inc.php +++ b/config.inc.php @@ -301,6 +301,10 @@ $CONF['show_popimap_color']='darkgrey'; // - 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: diff --git a/functions.inc.php b/functions.inc.php index bd64e8ca..a0d53f4e 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -2140,7 +2140,13 @@ function gen_show_status ($show_alias) 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;