Skip to content

Overview method does not work if I enter a parameter other than 1 #74

@alexv96

Description

@alexv96

I have a problem or doubt more than anything else, I am occupying the overview method because I want to make the search list me even if it is from a UID onwards, the issue that I know that a mail has as UID 165 -168 to 185 but when I put the range brings me null and if I list from 1:* brings me all but I would like to start from a specific sequence and not from the beginning.

This is the code that I am occupying.

$cm = new ClientManager([
                'options' => [
                    'fetch' => \Webklex\PHPIMAP\IMAP::FT_PEEK,
                    'fetch_order' => 'desc',
                    'sequence' => \Webklex\PHPIMAP\IMAP::FT_UID,
                ],
            ]);
            
            $oClient = $cm->make([
                'host' => 'imap.gmail.com',
                'port' => 993,
                'protocol' => 'imap',
                'encryption' => 'ssl',
                'validate_cert' => true,
                'username' => 'jer******@gmail.com',
                'password' => '*****',
            ]);
               
            $oClient->connect();
            $folder = $oClient->getFolder('INBOX');
            $message = $folder->overview($range = "1:*");//Working ✔
            //$message = $folder->overview($range = "168:*");//Not working ❌

            foreach ($message as $key => $value) {
                
                dd($folder->query()->getMessageByUid($key));
            }

If I occupy $folder->overview('1:*'); it brings me this

image

But if I occupy $folder->overview('168:*'); it brings me null

image

Because the idea of this method would be to bring a quick description between 2 ranges, but I don't know if the sequence works by UID search or by a number as it is in the mail

Here I made the query $folder->query()->getMessage(165) ; to check if this UID exists so the overview method should work too and not bring me null.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions