Commit d9e62c6
Fix: Sort emails by date instead of UID order (#98)
The order parameter was sorting by IMAP UID order, which doesn't
guarantee chronological order on all servers. ProtonMail Bridge
(and potentially others) assign UIDs in non-chronological order,
causing order=desc to return oldest emails instead of newest.
This fix:
- Fetches metadata for all matching emails
- Sorts by the actual email Date header
- Applies pagination after sorting
Fixes #97
Co-authored-by: Jack Koch <jack@jbkjr.me>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 72b2d59 commit d9e62c6
1 file changed
+14
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
275 | 273 | | |
276 | 274 | | |
277 | | - | |
| 275 | + | |
278 | 276 | | |
279 | 277 | | |
280 | 278 | | |
| |||
343 | 341 | | |
344 | 342 | | |
345 | 343 | | |
346 | | - | |
| 344 | + | |
347 | 345 | | |
348 | 346 | | |
349 | 347 | | |
350 | 348 | | |
351 | 349 | | |
352 | 350 | | |
353 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
354 | 361 | | |
355 | 362 | | |
356 | 363 | | |
| |||
0 commit comments