add imap client protocol, types, mock for testing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 18:27:20 +01:00
parent 4670612e75
commit ce5c985272
6 changed files with 141 additions and 2 deletions
@@ -0,0 +1,9 @@
public protocol IMAPClientProtocol: Sendable {
func connect() async throws
func disconnect() async throws
func listMailboxes() async throws -> [IMAPMailboxInfo]
func selectMailbox(_ name: String) async throws -> IMAPMailboxStatus
func fetchEnvelopes(uidsGreaterThan uid: Int) async throws -> [FetchedEnvelope]
func fetchFlags(uids: ClosedRange<Int>) async throws -> [UIDFlagsPair]
func fetchBody(uid: Int) async throws -> (text: String?, html: String?)
}