} elseif ($message->att_local_name) {
$filename = $message->att_local_name;
$file = fopen ($filename, 'rb');
- $encoded = '';
while ($tmp = fread($file, 570)) {
$body_part = chunk_split(base64_encode($tmp));
$length += $this->clean_crlf($body_part);
$header[] .= 'Content-Description: ' . $mime_header->description . $rn;
}
if ($mime_header->encoding) {
- $encoding = $mime_header->encoding;
$header[] .= 'Content-Transfer-Encoding: ' . $mime_header->encoding . $rn;
} else {
if ($mime_header->type0 == 'text' || $mime_header->type0 == 'message') {
}
}
-?>
+?>
\ No newline at end of file
}
-?>
+?>
\ No newline at end of file
}
-?>
+?>
\ No newline at end of file
}
}
-?>
+?>
\ No newline at end of file
}
}
-?>
+?>
\ No newline at end of file
}
}
-?>
+?>
\ No newline at end of file
}
function getFilename() {
- $filename = '';
$filename = $this->header->getParameter('filename');
if (!$filename) {
$filename = $this->header->getParameter('name');
function getAddressTokens($address) {
$aTokens = array();
- $aAddress = array();
$aSpecials = array('(' ,'<' ,',' ,';' ,':');
$aReplace = array(' (',' <',' ,',' ;',' :');
$address = str_replace($aSpecials,$aReplace,$address);
function parseAddress($address,$ar=false,$aAddress=array(),$sGroup='',$sHost='',$lookup=false) {
$aTokens = $this->getAddressTokens($address);
- $sPersonal = $sEmail = $sComment = $sGroup = '';
+ $sPersonal = $sEmail = $sGroup = '';
$aStack = $aComment = array();
foreach ($aTokens as $sToken) {
$cChar = $sToken{0};
if (is_array($arr)) {
foreach($arr as $arg) {
if ($this->getAddr_s($arg, $separator, $encoded)) {
- $s .= $separator . $result;
+ $s .= $separator;
}
}
$s = ($s ? substr($s, 2) : $s);
$i=0;
foreach($address as $argument) {
$match = $this->findAddress($argument, true);
- $last = end($match);
if ($match[1]) {
return $i;
} else {
* @return string Decoded string
*/
function charset_decode_utf_8 ($string) {
- global $default_charset,$squirrelmail_language;
+ global $squirrelmail_language;
if ($squirrelmail_language == 'ja_JP')
return $string;
/* especially usefull when $url = $PHP_SELF */
function set_url_var($url, $var, $val=0, $link=true) {
$k = '';
- $ret = '';
$pat_a = array (
'/.+(\\&'.$var.')=(.*)\\&/AU', /* in the middle */
'/.+\\?('.$var.')=(.*\\&).+/AU', /* at front, more follow */
if ($sm_notAlias=='tr_TR') setlocale(LC_CTYPE,'C');
// Set text direction/alignment variables
+ // These don't appear to be used... are they safe to remove?
if (isset($languages[$sm_notAlias]['DIR']) &&
$languages[$sm_notAlias]['DIR'] == 'rtl') {
/**
"\xc3\xa5\xe3\xa5\xe5\xa5\xe7\xa5\xee\xa5\xf5\xa5\xf6\xa1\xa6\xa1\xbc" .
"\xa1\xb3\xa1\xb4\xa1\xaa\xa1\xf3\xa1\xcb\xa1\xa4\xa1\xa5\xa1\xa7\xa1" .
"\xa8\xa1\xa9\xa1\xcf\xa1\xd1";
+ // This don't appear to be used... is it safe to remove?
$no_end = "\x5c\x24\x28\x5b\x7b\xa1\xf2\x5c\xa1\xc6\xa1\xc8\xa1\xd2\xa1" .
"\xd4\xa1\xd6\xa1\xd8\xa1\xda\xa1\xcc\xa1\xf0\xa1\xca\xa1\xce\xa1\xd0\xa1\xef";
{
$search_charset = sqimap_asearch_get_charset();
- $mbox_msgs = array();
$mbox_search = array();
$search_string = '';
$cur_mailbox = $mailbox_array[0];
$resultlist = array();
$data = array();
$read = sqimap_fgets($imap_stream);
- $i = $k = 0;
+ $i = 0;
while ($read) {
$char = $read{0};
switch ($char)
function sqimap_mailbox_list($imap_stream, $force=false) {
- global $default_folder_prefix;
-
if (!sqgetGlobalVar('boxesnew',$boxesnew,SQ_SESSION) || $force) {
global $data_dir, $username, $list_special_folders_first,
$folder_prefix, $trash_folder, $sent_folder, $draft_folder,
$move_to_trash, $move_to_sent, $save_as_draft,
$delimiter, $noselect_fix_enable, $imap_server_type;
- $inbox_in_list = false;
$inbox_subscribed = false;
$listsubscribed = sqimap_capability($imap_stream,'LIST-SUBSCRIBED');
$read_ary = compact_mailboxes_response($read_ary);
$g = 0;
- $phase = 'inbox';
$fld_pre_length = strlen($folder_prefix);
for ($i = 0, $cnt = count($read_ary); $i < $cnt; $i++) {
/* Store the raw IMAP reply */
$folder_prefix, $delimiter, $trash_folder, $move_to_trash,
$imap_server_type;
-
- $inbox_in_list = false;
- $inbox_subscribed = false;
$noselect = false;
$noinferiors = false;
$move_to_trash, $move_to_sent, $save_as_draft,
$delimiter, $imap_server_type;
- $special_folders = array ('INBOX', $sent_folder, $draft_folder, $trash_folder);
+ // $special_folders = array ('INBOX', $sent_folder, $draft_folder, $trash_folder);
/* create virtual root node */
$mailboxes= new mailboxes();
if (isset($folder_prefix) && ($folder_prefix != '')) {
$start = substr_count($folder_prefix,$delimiter);
if (strrpos($folder_prefix, $delimiter) == (strlen($folder_prefix)-1)) {
- $trail_del = true;
$mailboxes->mailboxname_full = substr($folder_prefix,0, (strlen($folder_prefix)-1));
} else {
$mailboxes->mailboxname_full = $folder_prefix;
function sqimap_get_status_mbx_tree($imap_stream,&$mbx_tree) {
global $unseen_notify, $unseen_type, $trash_folder,$move_to_trash;
- $aMbxs = $aQuery = $aTag = array();
+ $aMbxs = $aQuery = array();
sqimap_tree_to_ref_array($mbx_tree,$aMbxs);
// remove the root node
array_shift($aMbxs);
function sqimap_get_sort_order($imap_stream, $sSortField, $reverse, $search='ALL') {
global $default_charset;
- $id = array();
- $sort_test = array();
- $sort_query = '';
-
if ($sSortField) {
if ($reverse) {
$sSortField = 'REVERSE '.$sSortField;
$thread_temp = preg_split("//", $thread_list, -1, PREG_SPLIT_NO_EMPTY);
}
- $char_count = count($thread_temp);
$counter = 0;
$thread_new = array();
$k = 0;
$aFetchItems = array('FLAGS', 'RFC822.SIZE', 'INTERNALDATE')) {
$aMessageList = array();
- $read_list = array();
$bUidFetch = ! in_array('UID', $aFetchItems, true);
}
} else {
$msgs_str = '1:*';
- $aId = array();
}
/*
$pos = $search_position;
- $urlMailbox = urlencode($mailbox);
-
/* construct the search query, taking multiple search terms into account */
$multi_search = array();
$search_what = trim($search_what);
for ($q = 0; $q < $cnt; $q++) {
$id[$q] = trim($messagelist[$q]);
}
- $issent = ($mailbox == $sent_folder);
$msgs = fillMessageArray($imapConnection,$id,$cnt);
$aFlags = (isset($msg['FLAGS'])) ? $msg['FLAGS'] : array();
$iPrio = (isset($msg['PRIORITY'])) ? $msg['PRIORITY'] : 3;
$iSize = (isset($msg['SIZE'])) ? $msg['SIZE'] : 0;
+
+ // These don't appear to be used... are they safe to remove
$sType0 = (isset($msg['TYPE0'])) ? $msg['TYPE0'] : 'text';
$sType1 = (isset($msg['TYPE1'])) ? $msg['TYPE1'] : 'plain';
if (isset($msg['INTERNALDATE'])) {
$senderName = truncateWithEntities($senderName, $truncate_sender);
}
- $flag = $flag_end = $bold = $bold_end = $fontstr = $fontstr_end = $italic = $italic_end = '';
+ $flag = $flag_end = $fontstr = $fontstr_end = $italic = $italic_end = '';
$bold = '<b>';
$bold_end = '</b>';
/**
* In case the properties arrays are empty set the defaults.
*/
+ // Doesn't appear to be used... safe to remove?
$aDefaultMbxPref = array ();
// MBX_PREF_SORT => 0,
// MBX_PREF_LIMIT => 15,
(!($newsort % 2) && ($newsort - 1 == $oldsort))) {
$aMailbox['UIDSET'][$iSetIndx] = array_reverse($aCachedMailbox['UIDSET'][$iSetIndx]);
} else {
- $server_sort_array = false;
$aMailbox['MSG_HEADERS'] = false;
$aMailbox['ID'] = false;
}
$php_self = $PHP_SELF;
- $urlMailbox = urlencode($aMailbox['NAME']);
-
if (preg_match('/^(.+)\?.+$/',$php_self,$regs)) {
$source_url = $regs[1];
} else {
$links['download link']['text'] = _("Download");
$links['download link']['href'] = SM_PATH .
"src/download.php?absolute_dl=true&passed_id=$id&mailbox=$urlMailbox&ent_id=$ent";
- $ImageURL = '';
if ($type0 =='message' && $type1 == 'rfc822') {
$default_page = SM_PATH . 'src/read_body.php';
$rfc822_header = $att->rfc822_header;
break;
}
- $tag_start = $pos;
$tagname = '';
/**
* Look for next [\W-_], which will indicate the end of the tag name.
* At this point we loop in order to find all attributes.
*/
$attname = '';
- $atttype = false;
$attary = Array();
while ($pos <= strlen($body)){
function sq_body2div($attary, $mailbox, $message, $id){
$me = 'sq_body2div';
$divattary = Array('class' => "'bodyclass'");
- $bgcolor = '#ffffff';
$text = '#000000';
$has_bgc_stl = $has_txt_stl = false;
$styledef = '';
function do_hook ($name) {
global $squirrelmail_plugin_hooks, $currentHookName;
$data = func_get_args();
- $ret = '';
$currentHookName = $name;
if (isset($squirrelmail_plugin_hooks[$name])
$iLimit = $aProps['limit'];
$aTokens = _getAddressTokens($sAddress);
- $sPersonal = $sEmail = $sComment = $sGroup = '';
+ $sEmail = $sGroup = '';
$aStack = $aComment = $aAddress = array();
foreach ($aTokens as $sToken) {
if ($iLimit && $iLimit == count($aAddress)) {
function _getAddressTokens($address) {
$aTokens = array();
- $aAddress = array();
$aSpecials = array('(' ,'<' ,',' ,';' ,':');
$aReplace = array(' (',' <',' ,',' ;',' :');
$address = str_replace($aSpecials,$aReplace,$address);
while (($mypos < $length) && ($body{$mypos} == '>')) {
$mypos++;
// skip over any spaces interleaved among the cite markers
- $oldpos = $mypos;
while (($mypos < $length) && ($body{$mypos} == ' ')) {
$mypos++;
}
//main logic for month view of calendar
function drawmonthview() {
- global $year, $month, $day, $color, $calendardata, $todayis;
+ global $year, $month, $color, $calendardata, $todayis;
$aday = 1 - date('w', mktime(0, 0, 0, $month, 1, $year));
$days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year));
if ($Count == 0) {
$pop3->quit();
continue;
- } else {
- $newmsgcount = $Count - $i + 1;
}
// Faster to get them all at once
$newmail_recent;
$mailboxURL = urlencode($real_box);
- $unseen = $recent = 0;
// Skip folders for Sent and Trash
for ($i = 0;$i < count($boxes); $i++) {
- $line = '';
$mailbox = $boxes[$i]['formatted'];
if (! isset($boxes[$i]['unseen'])) {
$message = $message->parent;
}
if ($response == 'OK') {
- $subject = encodeHeader($message->rfc822_header->subject);
array_shift($body_a);
$body = implode('', $body_a) . "\r\n";
/**
* 1) Remove the addresses we'll be sending the message 'to'
*/
- $url_replytoall_avoid_addrs = '';
if (isset($header->replyto)) {
$excl_ar = $header->getAddr_a('replyto');
}
$orig_header = $message->rfc822_header;
}
- $encoding = $message->header->encoding;
$type0 = $message->type0;
$type1 = $message->type1;
foreach ($entities as $ent) {
function showInputForm ($session, $values=false) {
global $send_to, $send_to_cc, $body, $startMessage, $action,
$color, $use_signature, $signature, $prefix_sig,
- $editor_size, $editor_height, $attachments, $subject, $newmail,
+ $editor_size, $editor_height, $subject, $newmail,
$use_javascript_addr_book, $send_to_bcc, $passed_id, $mailbox,
$from_htmladdr_search, $location_of_buttons, $attachment_dir,
$username, $data_dir, $identity, $idents, $delete_draft,
$pre = "<a class=\"mbx_link\" href=\"right_main.php?PG_SHOWALL=0&startMessage=1&mailbox=$mailboxURL\" target=\"right\">" . $pre;
$end .= '</a>';
if ($numMessages > 0) {
- $urlMailbox = urlencode($mailbox);
$end .= "\n<small>\n" .
' [<a class="mbx_link" href="empty_trash.php">'._("Purge").'</a>]'.
'</small>';
}
function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
- global $username, $attachment_dir, $popuser, $username,
+ global $username, $attachment_dir, $popuser, $username, $color,
$version, $squirrelmail_language, $default_charset,
$languages, $useSendmail, $domain, $sent_folder;
sqgetGlobalVar('SERVER_NAME', $SERVER_NAME, SQ_SERVER);
$header = $message->rfc822_header;
- $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
$rfc822_header = new Rfc822Header();
$content_type = new ContentType('multipart/report');
function parse_viewheader($imapConnection,$id, $passed_ent_id) {
- $header_full = array();
if (!$passed_ent_id) {
$read=sqimap_run_command ($imapConnection, "FETCH $id BODY[HEADER]",
true, $a, $b, TRUE);
// Always tremble background
// This might make people go insane. Yes! *Victory dance!*
function Darkness_HeaderPlugin() {
- global $PHP_SELF, $Darkness_Transition;
+ global $PHP_SELF;
if (substr($PHP_SELF, -18) == '/src/left_main.php') {
echo '<meta http-equiv="Page-Enter" content="' .