From 8b3976272f618effa307735407b467c2edf23b02 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Fri, 7 Oct 2011 22:57:43 +0000 Subject: [PATCH] list-virtual.php: - delivery to mailbox with a recipient delimiter (mailbox+foo@domain) was marked as "forward only" This fixes https://sourceforge.net/tracker/?func=detail&aid=3420440&group_id=191583&atid=937964 reported by on #postfixadmin git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1198 a1433add-5e2c-0410-b055-b7f2511e0802 --- list-virtual.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/list-virtual.php b/list-virtual.php index 97cbcc8f..a7f3c89f 100644 --- a/list-virtual.php +++ b/list-virtual.php @@ -216,6 +216,9 @@ $query = "$sql_select\n$mailbox_pagebrowser_query\n$sql_limit"; $result = db_query ($query); if ($result['rows'] > 0) { + $delimiter = preg_quote($CONF['recipient_delimiter'], "/"); + $goto_single_rec_del = ""; + while ($row = db_array ($result['result'])) { if ($display_mailbox_aliases) { $goto_split = explode(",", $row['goto']); @@ -223,7 +226,11 @@ if ($result['rows'] > 0) { $row['goto_other'] = array(); foreach ($goto_split as $goto_single) { - if ($goto_single == $row['username']) { # delivers to mailbox + if (!empty($CONF['recipient_delimiter'])) { + $goto_single_rec_del = preg_replace('/' .$delimiter. '[^' .$delimiter. '@]*@/', "@", $goto_single); + } + + if ($goto_single == $row['username'] || $goto_single_rec_del == $row['username']) { # delivers to mailbox $row['goto_mailbox'] = 1; } elseif (boolconf('vacation') && strstr($goto_single, '@' . $CONF['vacation_domain']) ) { # vacation alias - TODO: check for full vacation alias # skip the vacation alias, vacation status is detected otherwise