Lines Matching refs:mailbox
10 $mailbox_prefix = "phpttest"; // name used for test mailbox
13 * Create a test mailbox and populate with msgs
16 * @param int message_count number of test msgs to be written to new mailbox
18 * @return IMAP stream to new mailbox on success; FALSE on failure
23 // open a stream to default mailbox
31 echo "Create a temporary mailbox and add " . $message_count . " msgs\n";
34 echo "Can't create a temporary mailbox: " . imap_last_error(). "\n";
38 echo ".. mailbox '$new_mailbox' created\n";
40 // reopen stream to new mailbox
42 echo "can't re-open '$new_mailbox' mailbox: " . imap_last_error() . "\n";
50 * Create mailbox and fill with generic emails
53 * @param string $mailbox
57 $mailbox = $default_mailbox . "." . $mailbox_prefix . $mailbox_suffix;
59 $mailboxes = imap_getmailboxes($imap_stream, $mailbox, '*');
61 // check mailbox does not already exist
64 if ($value->name == $mailbox) {
65 exit ("TEST FAILED : Mailbox '$mailbox' already exists\n");
70 if (imap_createmailbox($imap_stream, $mailbox) === false) {
76 populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type);
79 return $mailbox;
83 * Populate a mailbox with generic emails
86 * @param string $mailbox
88 function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = "simple"){
130 imap_append($imap_stream, $mailbox, $msg);
135 * Get the mailbox name from a mailbox description, i.e strip off server details.
137 * @param string mailbox complete mailbox name
138 * @return mailbox name
140 function get_mailbox_name($mailbox){
142 if (preg_match('/\{.*?\}(.*)/', $mailbox, $match) != 1) {
143 echo "Unrecpognized mailbox name\n";