Skip to content

Commit

Permalink
Validate ACL identifiers
Browse files Browse the repository at this point in the history
... e.g. to prevent cyrus imap issues
  • Loading branch information
alecpl committed Jan 16, 2018
1 parent dbc7892 commit a6ad028
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/acl/acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,13 @@ private function action_save()
if (!strpos($user, '@') && ($realm = $this->get_realm())) {
$user .= '@' . rcube_utils::idn_to_ascii(preg_replace('/^@/', '', $realm));
}

// Make sure it's valid email address to prevent from "disappearing folder"
// issue in Cyrus IMAP e.g. when the acl user identifier contains spaces inside.
if (strpos($user, '@') && !rcube_utils::check_email($user, false)) {
$user = null;
}

$username = $user;
}

Expand Down

0 comments on commit a6ad028

Please sign in to comment.