javanile / php-imap2

PHP IMAP with OAUTH2
https://php-imap2.javanile.org/
GNU General Public License v3.0
51 stars 31 forks source link

IMAP2_SORT FUNCTION is missing the SEARCH option #25

Open haiderpro opened 1 year ago

haiderpro commented 1 year ago

imap2_sort is not able to use the search code in sort command (like 'SINCE "02 NOV 2022"') which is a normal imap_sort option used by many people. Please fix ASAP. Thank you!

imap_sort( IMAP\Connection $imap, int $criteria, bool $reverse, int $flags = 0, ?string $search_criteria = null, <-- THIS ONE IS MISSING IN IMAP2_SORT FUNCTION ?string $charset = null ): array|false

haiderpro commented 1 year ago

More details:

$result = imap2_sort($imap, SORTDATE, 1, SE_NOPREFETCH, 'SUBJECT logo'); // this should work but not working due to search option not supported even if connected via normal IMAP option of PHP-IMAP2

$result = imap2_sort($imap, SORTDATE, 1); // this (without search option) works in normal IMAP option of PHP-IMAP2

$result = imap2_sort($imap, SORTDATE, 1); // Even without search option this is not working correctly in OAUTH2 / access token mode of PHP-IMAP2 but it works if normal IMAP username password is used

Can these errors please be fixed little quickly? If you guys are busy, can you please point me where this SORT code is located so that I can try to fix it. Thanks!