diff --git a/src/Fetch/Server.php b/src/Fetch/Server.php index 32e57c1..23abd67 100644 --- a/src/Fetch/Server.php +++ b/src/Fetch/Server.php @@ -489,6 +489,32 @@ public function createMailBox($mailbox) return imap_createmailbox($this->getImapStream(), $this->getServerSpecification() . $mailbox); } + /** + * Subscribe to a mailbox to make it appear in mail-clients like Thunderbird. Useful after using + * the createMailBox-function, to make sure mail-clients show the folder. + * + * @param $mailbox + * + * @return bool + */ + public function subscribeMailBox($mailbox) + { + return imap_subscribe($this->getImapStream(), $this->getServerSpecification() . $mailbox); + } + + /** + * Unsubscribe the given mailbox. + * Opposite of subscribeMailBox-function + * + * @param $mailbox + * + * @return bool + */ + public function unsubscribeMailBox($mailbox) + { + return imap_unsubscribe($this->getImapStream(), $this->getServerSpecification() . $mailbox); + } + /** * List available mailboxes *