* * @throws MailProviderException */ public function listFolders(): array; /** * Returns a paginated list of message headers for the given folder. * * @return list * * @throws MailProviderException */ public function listMessages(string $folderPath, int $limit, int $offset): array; /** * Fetches the full message (headers + body + attachments list) by UID. * * @throws MailProviderException */ public function fetchMessage(string $folderPath, int $uid): MailMessageDetailDto; /** * Marks a message as read or unread on the IMAP server. * * @throws MailProviderException */ public function markRead(string $folderPath, int $uid, bool $read): void; /** * Marks a message as flagged (starred) or unflagged on the IMAP server. * * @throws MailProviderException */ public function markFlagged(string $folderPath, int $uid, bool $flagged): void; /** * Moves a message from one folder to another on the IMAP server. * * @throws MailProviderException */ public function moveMessage(string $folderPath, int $uid, string $targetFolder): void; /** * Fetches the raw binary content of an attachment by its MIME part number. * * @throws MailProviderException */ public function fetchAttachment(string $folderPath, int $uid, string $partNumber): string; }