-
-
Notifications
You must be signed in to change notification settings - Fork 183
Description
Hello,
we are building up a web project based on laravel-imap and tried to filter for the messageID which should be unique along a user's mailbox so that a user can select some messages and request to delete them.
I've tried several ways but can't figure out how to filter for the messageId in the Query::class.
My code so far:
[...]
$messageID = '4aac05f4.1c59fb81.22652.cb54@mx.google.com'
$oClient = new Client([
'username' => $current_mailaddress->username . '@turnierplanung.com',
'password' => $current_mailaddress->securetoken
]);
$oClient->connect();
$folders = $oClient->getFolders();
$mails = [];
foreach ($folders as $folder) {
//$mails[] = $folder->query()->whereMessageId($messageID)->get(); --> this throws an InvalidWhereQueryCriteriaException
$mails[] = $folder->query("Message-ID <". $messageID . ">")->get();
}
The current version shows all available messages without filtering them for the messageId.
I've looked this up @ https://github.com/Webklex/laravel-imap/blob/master/src/IMAP/Query/WhereQuery.php
There's a public function whereMessageId($msg_id) which does not work.
But public function whereUnseen() works fine - why?
How can I filter all messages for a given message id without gathering them all and filter them with my own logic?
Thanks in advance & Kind Regards