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

Search is returning messages from sub-directory #506

Open
HeldVomErdbeerfeld opened this issue May 8, 2021 · 3 comments
Open

Search is returning messages from sub-directory #506

HeldVomErdbeerfeld opened this issue May 8, 2021 · 3 comments
Labels

Comments

@HeldVomErdbeerfeld
Copy link

Q A
ddeboer/imap version 1.12.1
PHP version 8.0.5

If i loop over messages is INBOX i also get Messages from INBOX/Tets

Is there any solution to avoid this behaviour, or even manually find out, which mailbox a message belongs to, so i can manually skip if message is from sub-mailbox?

@Slamdunk
Copy link
Collaborator

Hi, that's a weird behavior, what's your email provider?

@sacerro
Copy link

sacerro commented Oct 21, 2024

Hi,
I'm having the same problem. I'm using Docker ghcr.io/docker-mailserver/docker-mailserver:latest to create a local mail server.

Version of ddeboer/imap: 1.18 with PHP 8.1

In my case:
I have my INBOX folder with 4 messages and a folder called Test inside INBOX ("INBOX.Test") with 2 messages. When I get the count of messages by ussing $mailbox->getMessages( )->count(); it returns 6 instead of 4. Mailbox is loaded with $mailbox = $this->connection->getMailbox( 'INBOX' );

Update:
Thunderbird app returns the correct amount of messages when I open INBOX (also webmail installed, Roundcube). It seems to be something related with this library.

@sacerro
Copy link

sacerro commented Oct 21, 2024

Update:
In my case the issue was related with a wrong usage of Message::move(). When I move the message I didn't call Connection::expunge.

This duplicates the message (but Thunderbird or webmail shows only one message, not duplicates) when moved as defined in PHP imap_mail_move function. I call this expunge method and now it returns messages correctly.

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

No branches or pull requests

3 participants