ddeboer / imap

Object-oriented, fully tested PHP IMAP library
MIT License
887 stars 253 forks source link

Search is returning results outside current mailbox #460

Open wrabit opened 4 years ago

wrabit commented 4 years ago

I am performing a search in a top level directory /Tests. This is verified before I perform the search:

{xxx-xxx.ms-acdc.office.com:993/imap/notls/ssl/user="xxx@xxx.com"}Tests

But mail results are being returned from outside this directory, i.e. /INBOX. I have read up and it seems that imap should be returning results from the currently selected mailbox / folder.

Just checking if I am missing something before I investigate further? TIA

wrabit commented 4 years ago

Something else fishy. I am now testing with the folder put inside Inbox (still resulting in issue above) but "$this->connection->getMailbox('INBOX/Tests')->getMessages()" returns mail from all folders, not my INBOX/Tests.

wrabit commented 4 years ago

I have resolved it but not sure this behaviour is intended.

I was instantiating 2 different instances. Although connection details were identical, the latter was not confining the results to the mailbox specified.

Slamdunk commented 4 years ago

I was instantiating 2 different instances.

This isn't tested indeed, and also not supported by imap ext I think