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

Messages fetched by UID don't have $messageNum as key #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pjio
Copy link

@pjio pjio commented Nov 23, 2022

First thanks to everyone involved in this project!

About the problem:
I'm using this library alongside with https://github.com/ddeboer/imap, which uses the UID to identify messages. In Roundcube\ImapClient::fetch() the sequence-number (variable $id) is used as the key in $result, even when $is_uid is set to true. In Javanile\Imap2\Message depending on $flags the $messageNum-parameter could either be the sequence-number or the UID. Therefore some methods fail to access the result.

What I've changed:
array_pop() is used to retrieve the message from the array and should work with sequence-numbers and UID.
If FT_UID is set, $messages will have the uid as the key in the affected functions (no change was required to Roundcube).

How I've tested it:
I fetched mails from Outlook365 via OAuth2 and by UID successfully with this change.

Possibly related:
#15
#18

@IZSkiSurfer
Copy link

Also check #32
This is a design flaw by roundcubes library. Check my ticket for how to handle it the "roundcube way"

@pjio
Copy link
Author

pjio commented Nov 28, 2022

@IZSkiSurfer I've changed the PR to the "Roundcube way".

image

This is more explicit and should have no side effects.

@IZSkiSurfer
Copy link

Thanks @pjio your fix looks fine and dandy ;)
I guess the tickets could be closed or marked as fixed with the next version.

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

Successfully merging this pull request may close these issues.

2 participants