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

listMessages() returned empty array due to trailing whitespace in IMAP response #225

Open
achtnullacht opened this issue Nov 3, 2015 · 1 comment

Comments

@achtnullacht
Copy link

Connecting to an Exchange 2007 server via imap, listMessages() returned an empty array. Reason: the IMAP response line that is being matched in line 1217 had an extra trailing whitespace.

Changing the regex in line 1217 to match the possible trailing whitespace worked for me:
if (preg_match('#^\s*\*\s+STATUS\s+"?INBOX"?\s+\((.*)\)\s+$#', $line, $match)) {

Any idea if the trailing whitespace is an issue of the Exchange servers config?

@BrendonKoz
Copy link

If it's a greedy REGEX, shouldn't the * work just as well as the + metacharacter? I unfortunately am not allowed to connect to our 2007 Exchange server (disabled at the administrative level) or I'd try it out, but theoretically I'm thinking the original code should work just as well as this.

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