diff --git a/functions.inc.php b/functions.inc.php
index 2ec29858..150f0e13 100644
--- a/functions.inc.php
+++ b/functions.inc.php
@@ -2007,8 +2007,16 @@ function gen_show_status($show_alias) {
//make sure this alias goes somewhere known
$stat_ok = 1;
- while (($g=array_pop($gotos)) && $stat_ok) {
- list(/*NULL*/, $stat_domain) = explode('@', $g);
+ foreach($gotos as $g) {
+ if(!$stat_ok) {
+ break;
+ }
+ if(strpos($g, '@') === false) {
+ continue;
+ }
+
+ list($local_part, $stat_domain) = explode('@', $g);
+
$stat_delimiter = "";
if (!empty($CONF['recipient_delimiter'])) {
$stat_delimiter = "OR address = '" . escape_string(preg_replace($delimiter_regex, "@", $g)) . "'";
@@ -2024,8 +2032,7 @@ function gen_show_status($show_alias) {
}
} // while
if ($stat_ok == 0) {
- $stat_string .= "" . $CONF['show_status_text'] . " ";
+ $stat_string .= "" . $CONF['show_status_text'] . " ";
} else {
$stat_string .= $CONF['show_status_text'] . " ";
}
diff --git a/model/AliasHandler.php b/model/AliasHandler.php
index 96a46ac2..cff9b433 100644
--- a/model/AliasHandler.php
+++ b/model/AliasHandler.php
@@ -459,7 +459,8 @@ class AliasHandler extends PFAHandler {
}
} else {
$email_check = check_email($singlegoto);
- if ($email_check != '') {
+ // preg_match -> allows for redirect to a local system account.
+ if ($email_check != '' && !preg_match( '/^[a-z0-9]+$/', $singlegoto)) {
$errors[] = "$singlegoto: $email_check";
}
}