mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
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'] git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@650 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
parent
4e69d49089
commit
9102b62a6e
@ -301,6 +301,10 @@ $CONF['show_popimap_color']='darkgrey';
|
|||||||
// - add the corresponding color to show_custom_colors
|
// - add the corresponding color to show_custom_colors
|
||||||
$CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext");
|
$CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext");
|
||||||
$CONF['show_custom_colors']=array("lightgreen","lightblue");
|
$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:
|
// Optional:
|
||||||
|
@ -2140,7 +2140,13 @@ function gen_show_status ($show_alias)
|
|||||||
while ( ($g=array_pop($gotos)) && $stat_ok )
|
while ( ($g=array_pop($gotos)) && $stat_ok )
|
||||||
{
|
{
|
||||||
$stat_catchall = substr($g,strpos($g,"@"));
|
$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)
|
if ($stat_result['rows'] == 0)
|
||||||
{
|
{
|
||||||
$stat_ok = 0;
|
$stat_ok = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user