Lines Matching refs:mailbox

10 $mailbox_prefix = "phpttest"; // name used for test mailbox
59 * Create a test mailbox and populate with msgs
62 * @param int message_count number of test msgs to be written to new mailbox
64 * @return IMAP stream to new mailbox on success; FALSE on failure
69 // open a stream to default mailbox
77 echo "Create a temporary mailbox and add " . $message_count . " msgs\n";
80 echo "Cant create a temporary mailbox: " . imap_last_error(). "\n";
84 echo ".. mailbox '$new_mailbox' created\n";
86 // reopen stream to new mailbox
88 echo "cant re-open '$new_mailbox' mailbox: " . imap_last_error() . "\n";
96 * Create mailbox and fill with generic emails
99 * @param string $mailbox
103 $mailbox = $default_mailbox . "." . $mailbox_prefix . $mailbox_suffix;
105 $mailboxes = imap_getmailboxes($imap_stream, $mailbox, '*');
107 // check mailbox does not already exist
110 if ($value->name == $mailbox) {
111 exit ("TEST FAILED : Mailbox '$mailbox' already exists\n");
116 if (imap_createmailbox($imap_stream, $mailbox) === false) {
122 populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type);
125 return $mailbox;
129 * Populate a mailbox with generic emails
132 * @param string $mailbox
134 function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = "simple"){
176 imap_append($imap_stream, $mailbox, $msg);
181 * Get the mailbox name from a mailbox decription, i.e strip off server details.
183 * @param string mailbox complete mailbox name
184 * @return mailbox name
186 function get_mailbox_name($mailbox){
188 if (preg_match('/\{.*?\}(.*)/', $mailbox, $match) != 1) {
189 echo "Unrecpognized mailbox name\n";