Description
When using since criteria for searching emails by the date I have got an response exception ImapServerErrorException 'TAG4 NO SEARCH: mtd: internal error: Bad token (expecting date specification).' When I skip searching by date, everything works. Search is against email.cz server. Same problem was allready mentioned in different project which is using same library freescout-help-desk/freescout#4182
I'm using the latest library version 5.5
Used config
$imapClient = (new ClientManager(['date_format' => 'd-M-Y',
Code to Reproduce
$folder = $imapClient->getFolderByName('INBOX');
$messages = $folder->search()
->from('[email protected]')
->since(Carbon::now()->subDays(10))
->get();
How to solve it
Problem is in query->since, date should be without quotes. I need an option how to disable quotes around the date value.
When $tokens[0] in method ImapProtocol::requestAndResponse contain this string, response is an ImapServerErrorException
FROM "[email protected]" SINCE "07-Jan-2025"
but when string is changed to this, its ok
FROM "[email protected]" SINCE 07-Jan-2025