Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add multiple flags #225

Open
vajiralasantha opened this issue Jan 15, 2020 · 1 comment
Open

Unable to add multiple flags #225

vajiralasantha opened this issue Jan 15, 2020 · 1 comment

Comments

@vajiralasantha
Copy link

vajiralasantha commented Jan 15, 2020

I'm trying to set two flags to connect to a shared inbox. However when I use following commands, Only one flag get set.

$server = new Server($config->mailserver->host, $config->mailserver->port);
$server->setAuthentication(USER_NAME, PASSWORD);
$server->setFlag("authuser", "some@email.com");
$server->setFlag("user", "shared@email.com");

The server string comes as
{outlook.office365.com:993/ssl/user=shared@email.com}

The string I suppose to get is
{outlook.office365.com:993/ssl/authuser=some@email.com/user=shared@email.com}

looks like this issue is caused by following piece of code in function setFlag() .

$match = preg_grep('/' . $flag . '/', $this->flags);
if (reset($match)) {
      $this->flags[key($match)] = $flag . '=' . $value;
} else {
      $this->flags[] = $flag . '=' . $value;
}

Any idea?

@Woodehh
Copy link

Woodehh commented Jul 17, 2020

Simple workaround for this, if you use $server->setFlag("authuser=some@email.com/user=shared@email.com"); it should work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants