array('delim' => .., 'flags' => ..)) * @throws RuntimeException */ public function folders(string $reference = '', string $folder = '*'): Response; /** * Set message flags * @param array|string $flags flags to set, add or remove * @param int $from message for items or start message if $to !== null * @param int|null $to if null only one message ($from) is fetched, else it's the * last message, INF means last message available * @param string|null $mode '+' to add flags, '-' to remove flags, everything else sets the flags as given * @param bool $silent if false the return values are the new flags for the wanted messages * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use * message numbers instead. * @param string|null $item command used to store a flag * * @return Response containing the new flags if $silent is false, else true or false depending on success * @throws RuntimeException */ public function store(array|string $flags, int $from, ?int $to = null, ?string $mode = null, bool $silent = true, int|string $uid = IMAP::ST_UID, ?string $item = null): Response; /** * Append a new message to given folder * @param string $folder name of target folder * @param string $message full message content * @param array|null $flags flags for new message * @param string|null $date date for new message * * @return Response * @throws RuntimeException */ public function appendMessage(string $folder, string $message, ?array $flags = null, ?string $date = null): Response; /** * Copy message set from current folder to other folder * * @param string $folder destination folder * @param $from * @param int|null $to if null only one message ($from) is fetched, else it's the * last message, INF means last message available * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use * message numbers instead. * * @return Response * @throws RuntimeException */ public function copyMessage(string $folder, $from, ?int $to = null, int|string $uid = IMAP::ST_UID): Response; /** * Copy multiple messages to the target folder * @param array $messages List of message identifiers * @param string $folder Destination folder * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use * message numbers instead. * * @return Response Tokens if operation successful, false if an error occurred * @throws RuntimeException */ public function copyManyMessages(array $messages, string $folder, int|string $uid = IMAP::ST_UID): Response; /** * Move a message set from current folder to another folder * @param string $folder destination folder * @param $from * @param int|null $to if null only one message ($from) is fetched, else it's the * last message, INF means last message available * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use * message numbers instead. * * @return Response */ public function moveMessage(string $folder, $from, ?int $to = null, int|string $uid = IMAP::ST_UID): Response; /** * Move multiple messages to the target folder * * @param array $messages List of message identifiers * @param string $folder Destination folder * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use * message numbers instead. * * @return Response Tokens if operation successful, false if an error occurred * @throws RuntimeException */ public function moveManyMessages(array $messages, string $folder, int|string $uid = IMAP::ST_UID): Response; /** * Exchange identification information * Ref.: https://datatracker.ietf.org/doc/html/rfc2971 * * @param null $ids * @return Response * * @throws RuntimeException */ public function ID($ids = null): Response; /** * Create a new folder * * @param string $folder folder name * @return Response * @throws RuntimeException */ public function createFolder(string $folder): Response; /** * Rename an existing folder * * @param string $old old name * @param string $new new name * @return Response * @throws RuntimeException */ public function renameFolder(string $old, string $new): Response; /** * Delete a folder * * @param string $folder folder name * @return Response * * @throws ImapBadRequestException * @throws ImapServerErrorException * @throws RuntimeException */ public function deleteFolder(string $folder): Response; /** * Subscribe to a folder * * @param string $folder folder name * @return Response * * @throws ImapBadRequestException * @throws ImapServerErrorException * @throws RuntimeException */ public function subscribeFolder(string $folder): Response; /** * Unsubscribe from a folder * * @param string $folder folder name * @return Response * * @throws ImapBadRequestException * @throws ImapServerErrorException * @throws RuntimeException */ public function unsubscribeFolder(string $folder): Response; /** * Send idle command * * @throws RuntimeException */ public function idle(); /** * Send done command * @throws RuntimeException */ public function done(); /** * Apply session saved changes to the server * * @return Response * * @throws ImapBadRequestException * @throws ImapServerErrorException * @throws RuntimeException */ public function expunge(): Response; /** * Retrieve the quota level settings, and usage statics per mailbox * @param $username * * @return Response * @throws RuntimeException */ public function getQuota($username): Response; /** * Retrieve the quota settings per user * * @param string $quota_root * * @return Response * @throws ConnectionFailedException */ public function getQuotaRoot(string $quota_root = 'INBOX'): Response; /** * Send noop command * * @return Response * * @throws ImapBadRequestException * @throws ImapServerErrorException * @throws RuntimeException */ public function noop(): Response; /** * Do a search request * * @param array $params * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use * message numbers instead. * * @return Response containing the message ids * @throws RuntimeException */ public function search(array $params, int|string $uid = IMAP::ST_UID): Response; /** * Get a message overview * @param string $sequence uid sequence * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use * message numbers instead. * * @return Response * @throws RuntimeException * @throws MessageNotFoundException * @throws InvalidMessageDateException */ public function overview(string $sequence, int|string $uid = IMAP::ST_UID): Response; /** * Enable the debug mode */ public function enableDebug(); /** * Disable the debug mode */ public function disableDebug(); /** * Enable uid caching */ public function enableUidCache(); /** * Disable uid caching */ public function disableUidCache(); /** * Set the uid cache of current active folder * * @param array|null $uids */ public function setUidCache(?array $uids); }