Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
is_inbox) {
$acmp = '0'. $a->mailboxname_full;
} else if ($a->is_special) {
$acmp = '1'. $a->mailboxname_full;
} else {
$acmp = '2' . $a->mailboxname_full;
}
if ($b->is_inbox) {
$bcmp = '0'. $b->mailboxname_full;
}else if ($b->is_special) {
$bcmp = '1' . $b->mailboxname_full;
} else {
$bcmp = '2' . $b->mailboxname_full;
}
if ($acmp == $bcmp) return 0;
return ($acmp > $bcmp) ? 1: -1;
}
function find_mailbox_name ($mailbox) {
if (preg_match('/\*.+\"([^\r\n\"]*)\"[\s\r\n]*$/', $mailbox, $regs))
return $regs[1];
if (preg_match('/ *"([^\r\n"]*)"[ \r\n]*$/', $mailbox, $regs))
return $regs[1];
preg_match('/ *([^ \r\n"]*)[ \r\n]*$/',$mailbox,$regs);
return $regs[1];
}
/**
* @return bool whether this is a Noselect mailbox.
*/
function check_is_noselect ($lsub_line) {
return preg_match("/^\* (LSUB|LIST) \([^\)]*\\\\Noselect[^\)]*\)/i", $lsub_line);
}
/**
* If $haystack is a full mailbox name, and $needle is the mailbox
* separator character, returns the second last part of the full
* mailbox name (i.e. the mailbox's parent mailbox)
*/
function readMailboxParent($haystack, $needle) {
if ($needle == '') {
$ret = '';
} else {
$parts = explode($needle, $haystack);
$elem = array_pop($parts);
while ($elem == '' && count($parts)) {
$elem = array_pop($parts);
}
$ret = join($needle, $parts);
}
return( $ret );
}
/**
* Check if $subbox is below the specified $parentbox
*/
function isBoxBelow( $subbox, $parentbox ) {
global $delimiter;
/*
* Eliminate the obvious mismatch, where the
* subfolder path is shorter than that of the potential parent
*/
if ( strlen($subbox) < strlen($parentbox) ) {
return false;
}
/* check for delimiter */
if (substr($parentbox,-1) != $delimiter) {
$parentbox.=$delimiter;
}
if (substr($subbox,0,strlen($parentbox)) == $parentbox) {
return true;
} else {
return false;
}
}
/**
* Defines special mailboxes: given a mailbox name, it checks if this is a
* "special" one: INBOX, Trash, Sent or Draft.
*
* Since 1.2.5 function includes special_mailbox hook.
* Since 1.4.3 hook supports more than one plugin.
* @param string $box mailbox name
* @param boolean $include_subs (since 1.5.2 and 1.4.9) if true, subfolders of
* system folders are special. if false, subfolders are not special mailboxes
* unless they are tagged as special in 'special_mailbox' hook.
* @return boolean
* @since 1.2.3
*/
function isSpecialMailbox($box,$include_subs=true) {
$ret = ( (strtolower($box) == 'inbox') ||
isTrashMailbox($box,$include_subs) ||
isSentMailbox($box,$include_subs) ||
isDraftMailbox($box,$include_subs) );
if ( !$ret ) {
$ret = boolean_hook_function('special_mailbox',$box,1);
}
return $ret;
}
/**
* Detects if mailbox is a Trash folder or subfolder of Trash
* @param string $box mailbox name
* @param boolean $include_subs (since 1.5.2 and 1.4.9) if true, subfolders of
* system folders are special. if false, subfolders are not special mailboxes.
* @return bool whether this is a Trash folder
* @since 1.4.0
*/
function isTrashMailbox ($box,$include_subs=true) {
global $trash_folder, $move_to_trash;
return $move_to_trash && $trash_folder &&
( $box == $trash_folder ||
($include_subs && isBoxBelow($box, $trash_folder)) );
}
/**
* Detects if mailbox is a Sent folder or subfolder of Sent
* @param string $box mailbox name
* @param boolean $include_subs (since 1.5.2 and 1.4.9) if true, subfolders of
* system folders are special. if false, subfolders are not special mailboxes.
* @return bool whether this is a Sent folder
* @since 1.4.0
*/
function isSentMailbox($box,$include_subs=true) {
global $sent_folder, $move_to_sent;
return $move_to_sent && $sent_folder &&
( $box == $sent_folder ||
($include_subs && isBoxBelow($box, $sent_folder)) );
}
/**
* Detects if mailbox is a Drafts folder or subfolder of Drafts
* @param string $box mailbox name
* @param boolean $include_subs (since 1.5.2 and 1.4.9) if true, subfolders of
* system folders are special. if false, subfolders are not special mailboxes.
* @return bool whether this is a Draft folder
* @since 1.4.0
*/
function isDraftMailbox($box,$include_subs=true) {
global $draft_folder, $save_as_draft;
return $save_as_draft &&
( $box == $draft_folder ||
($include_subs && isBoxBelow($box, $draft_folder)) );
}
/**
* Expunges a mailbox, ie. delete all contents.
*/
function sqimap_mailbox_expunge ($imap_stream, $mailbox, $handle_errors = true, $id='') {
global $uid_support;
if ($id) {
if (is_array($id)) {
$id = sqimap_message_list_squisher($id);
}
$id = ' '.$id;
$uid = $uid_support;
} else {
$uid = false;
}
$read = sqimap_run_command($imap_stream, 'EXPUNGE'.$id, $handle_errors,
$response, $message, $uid);
$cnt = 0;
if (is_array($read)) {
foreach ($read as $r) {
if (preg_match('/^\*\s[0-9]+\sEXPUNGE/AUi',$r,$regs)) {
$cnt++;
}
}
}
return $cnt;
}
/**
* Checks whether or not the specified mailbox exists
*/
function sqimap_mailbox_exists ($imap_stream, $mailbox) {
if (!isset($mailbox) || empty($mailbox)) {
return false;
}
$mbx = sqimap_run_command($imap_stream, "LIST \"\" \"$mailbox\"",
true, $response, $message);
return isset($mbx[0]);
}
/**
* Selects a mailbox
*/
function sqimap_mailbox_select ($imap_stream, $mailbox) {
global $auto_expunge;
if (empty($mailbox)) {
return;
}
/**
* Default UW IMAP server configuration allows to access other files
* on server. $imap_server_type is not checked because interface can
* be used with 'other' or any other server type setting. $mailbox
* variable can be modified in any script that uses variable from GET
* or POST. This code blocks all standard SquirrelMail IMAP API requests
* that use mailbox with full path (/etc/passwd) or with ../ characters
* in path (../../etc/passwd)
*/
if (strstr($mailbox, '../') || substr($mailbox, 0, 1) == '/') {
global $color;
include_once(SM_PATH . 'functions/display_messages.php');
error_box(sprintf(_("Invalid mailbox name: %s"),htmlspecialchars($mailbox)),$color);
sqimap_logout($imap_stream);
die('