Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/Fetch/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down