You are here

function MailhandlerPhpImapRetrieve::mailbox_string in Mailhandler 6.2

Same name and namespace in other branches
  1. 7.2 modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php \MailhandlerPhpImapRetrieve::mailbox_string()

Constructs a mailbox string based on mailbox object

2 calls to MailhandlerPhpImapRetrieve::mailbox_string()
MailhandlerPhpImapRetrieve::open_mailbox in modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php
Establish IMAP stream connection to specified mailbox.
MailhandlerPhpImapRetrieve::test in modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php
Test connection to a mailbox.

File

modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php, line 157
Definition of MailhandlerPhpImapRetrieve class.

Class

MailhandlerPhpImapRetrieve
Retrieve messages using PHP IMAP library.

Code

function mailbox_string($mailbox) {
  extract($mailbox->settings);
  switch ($type) {
    case 'imap':
      return '{' . $domain . ':' . $port . $extraimap . '}' . $folder;
    case 'pop3':
      return '{' . $domain . ':' . $port . '/pop3' . $extraimap . '}' . $folder;
    case 'local':
      $box = $folder;
      if ($readonly) {

        // Copy mbox to avoid modifying original.
        $source = $box;
        $destination = file_directory_temp();
        $replace = FILE_EXISTS_REPLACE;
        $box = realpath($destination . '/' . basename($source));
      }
      return $box;
  }
}