Commit Graph
23 Commits
Author SHA1 Message Date
Oliver Drobnik 510aff7306 Update search function to accept sort criteria and add SortCriteria enum
* Add `sortCriteria` parameter to `search` function in `IMAPServer.swift`
* Create `SortCriteria` enum with options for `DATE`, `ARRIVAL`, `FROM`, `TO`, `SUBJECT`, `SIZE`, and `REVERSE`
* Implement method to convert `SortCriteria` to NIO IMAP types
2025-03-12 15:14:58 +01:00
Oliver Drobnik a7d5501fe7 Enhance IMAP search functionality and error handling 2025-03-11 22:31:57 +01:00
Oliver Drobnik 9ab94677ff Implement basic search functionality in IMAP
Related to #9

Implement basic IMAP search functionality.

* Add `SearchCommand` struct in `Sources/SwiftIMAP/IMAP/Commands/SearchCommand.swift` conforming to `IMAPCommand` protocol.
  * Add properties `identifierSet` and `criteria`.
  * Implement `toTaggedCommand` method to convert to IMAP tagged command.
  * Add initializer to accept `identifierSet` and `criteria` parameters.
* Add `SearchHandler` class in `Sources/SwiftIMAP/IMAP/Handler/SearchHandler.swift` conforming to `IMAPCommandHandler` protocol.
  * Add properties to store search results.
  * Implement `processResponse` method to handle tagged and untagged responses.
  * Implement `handleTaggedOKResponse` and `handleTaggedErrorResponse` methods.
* Add `SearchCriteria` enum in `Sources/SwiftIMAP/Models/SearchCriteria.swift` to model Swift NIO IMAP criteria.
  * Include cases like `.uid(number)`, `.unseen`, `.smaller(number)`, etc.
* Modify `Sources/SwiftIMAP/IMAPServer.swift` to implement `search` function with a generic type `<T: MessageIdentifier>`.
  * Accept parameters: `identifierSet` (optional) and `criteria` (array of enums).
  * Return a collection of message identifiers `[T]`.
  * Switch between `.search` and `.uidSearch` based on the type of `T`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Cocoanetics/SwiftMail/issues/9?shareId=XXXX-XXXX-XXXX-XXXX).
2025-03-11 21:22:31 +01:00
Oliver Drobnik b698b619cd removed unnessary import breaking Linux build 2025-03-07 13:33:16 +01:00
Oliver Drobnik f920fad29f WIP support for SPECIAL-USE IMAP capability 2025-03-06 21:46:17 +01:00
Oliver Drobnik 62927bdea7 Add convenience method to get latest messages quicker 2025-03-06 10:38:06 +01:00
Oliver Drobnik 76c737a969 experiment with unifying loggers 2025-03-05 21:50:18 +01:00
Oliver Drobnik a5ee057dcf cleanup 2025-03-03 21:09:34 +01:00
Oliver Drobnik 5c1cc7b692 cleanup 2025-03-03 20:46:29 +01:00
Oliver Drobnik 587a5512ed trying to unify Mailbox functions 2025-03-03 20:20:44 +01:00
Oliver Drobnik 4eab74fe68 implement mailbox listing 2025-03-03 12:43:26 +01:00
Oliver Drobnik 10bb98f705 renamed model types 2025-03-03 11:06:36 +01:00
Oliver Drobnik 4e4fffac91 unify naming of functions 2025-03-03 10:14:42 +01:00
Oliver Drobnik a64a12c743 improve date handling 2025-03-03 09:30:13 +01:00
Oliver Drobnik 5a9ebd12cc make flags an enum 2025-03-03 09:11:04 +01:00
Oliver Drobnik 5c86ce05c6 WIP implement Capabilities 2025-02-28 21:12:33 +01:00
Oliver Drobnik f2e13ebef0 refactor function 2025-02-27 15:04:41 +01:00
Oliver Drobnik 0cf926a49f improve 2025-02-27 14:17:10 +01:00
Oliver Drobnik af2df56537 progress 2025-02-27 08:45:04 +01:00
Oliver Drobnik 4b2ae1ce80 converted fetch to use new Message ID Index Set typed between SequenceNumber or UID 2025-02-27 08:13:59 +01:00
Oliver Drobnik 1f93de35f0 begin MessageIdentifierSet implementation 2025-02-26 23:49:22 +01:00
Oliver Drobnik 8291dfbe88 Added missing files 2025-02-26 15:28:52 +01:00
Oliver Drobnik 3ce8a255d5 massive cleanup 2025-02-26 11:26:18 +01:00