24 lines
1.1 KiB
Swift
24 lines
1.1 KiB
Swift
import Foundation
|
|
|
|
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?)
|
|
|
|
// v0.5 attachment/MIME operations
|
|
func fetchFullMessage(uid: Int) async throws -> String
|
|
func fetchSection(uid: Int, mailbox: String, section: String) async throws -> Data
|
|
|
|
// v0.3 write operations
|
|
func storeFlags(uid: Int, mailbox: String, add: [String], remove: [String]) async throws
|
|
func moveMessage(uid: Int, from: String, to: String) async throws
|
|
func copyMessage(uid: Int, from: String, to: String) async throws
|
|
func expunge(mailbox: String) async throws
|
|
func appendMessage(to mailbox: String, message: Data, flags: [String]) async throws
|
|
func capabilities() async throws -> Set<String>
|
|
}
|