phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: email/inc class.boaction.inc.php,1.11,1.12 class


From: Angelo Tony Puglisi <address@hidden>
Subject: [Phpgroupware-cvs] CVS: email/inc class.boaction.inc.php,1.11,1.12 class.bocompose.inc.php,1.1,1.2 class.boindex.inc.php,1.20,1.21 class.bomessage.inc.php,1.5,1.6 class.bosend.inc.php,1.6,1.7 class.mail_msg_base.inc.php,1.61,1.62 class.mail_msg_display.inc.php,1.31,1.32 class.mail_msg_wrappers.inc.php,1.23,1.24 class.uicompose.inc.php,1.1,1.2 class.uimessage.inc.php,1.2,1.3 class.uipreferences.inc.php,1.9,1.10 hook_home.inc.php,1.48,1.49
Date: Mon, 14 Jan 2002 15:51:42 -0500

Update of /cvsroot/phpgroupware//email/inc
In directory subversions:/tmp/cvs-serv5685/email/inc

Modified Files:
        class.boaction.inc.php class.bocompose.inc.php 
        class.boindex.inc.php class.bomessage.inc.php 
        class.bosend.inc.php class.mail_msg_base.inc.php 
        class.mail_msg_display.inc.php class.mail_msg_wrappers.inc.php 
        class.uicompose.inc.php class.uimessage.inc.php 
        class.uipreferences.inc.php hook_home.inc.php 
Log Message:
add bcc, real names in address book to compose page, download raw email, bug 
fixes I cant remember, like rfc default to type text instead of unknown, move 
messages and change accounts from the message view page itself, other stuff

Index: class.boaction.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.boaction.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.boaction.inc.php      12 Jan 2002 02:38:14 -0000      1.11
--- class.boaction.inc.php      14 Jan 2002 20:51:37 -0000      1.12
***************
*** 74,78 ****
                        {
                                if ($this->debug > 0) { echo 
'emai.boaction.delmov: get_arg_value(what) == "move") <br>'; }
!                               // called by the "move selected messages to" 
listbox onChange action
                                
                                /*
--- 74,80 ----
                        {
                                if ($this->debug > 0) { echo 
'emai.boaction.delmov: get_arg_value(what) == "move") <br>'; }
!                               // (1) generally called by the "move selected 
messages to" listbox onChange action
!                               // (2) also can be called by uimessage "move 
this message into" listbox onChange action
!                               //  if (2) then this flag is set as such: 
msgball[called_by] = uimessage
                                
                                /*
***************
*** 100,103 ****
--- 102,148 ----
                                
                                $delmov_list = 
$GLOBALS['phpgw']->msg->get_arg_value('delmov_list');
+                               
+                               // were we called by uimessage, if so, then 
treat the post-move navigation like a "delete_single_msg"
+                               if ((isset($delmov_list[0]['called_by']))
+                               && ($delmov_list[0]['called_by'] == 
'uimessage'))
+                               {
+                                       // BEFORE we move, if there is no mext 
message, then we will go back to index page
+                                       $nav_data = 
$GLOBALS['phpgw']->msg->prev_next_navigation();
+                                       if ($this->debug > 2) { echo 
'emai.boaction.delmov: move single *called by uimessage*: pre-move $nav_data[] 
dump <pre>: '; print_r($nav_data); echo '</pre>'; }
+                                       // ----  "Go To Previous Message" 
Handling  -----
+                                       // this is actually a little broken 
when moving a single message when called by uimessage
+                                       // this is a workaround the almost 
works, it takes you to the message you looked a 1 message ago
+                                       // whereas I think you should go to the 
next message, but next_msg data is not passed by prev_next_navigation when
+                                       // we're called by uimessage, this also 
means that with one message left in the folder *after* the move, this code
+                                       // thinks the folder is empty and takes 
us to uiindex *for the same folder* though, so at lease the user knows
+                                       // there's a mail left in that folder
+                                       // FUTURE: pass these insrustions from 
hidden data obtained from uimessage when prev_next_navigation is more accurate
+                                       if (($nav_data['prev_msg'] != $not_set)
+                                       && ((string)$nav_data['lowest_left'] != 
'0') 
+                                       && ((string)$nav_data['highest_right'] 
!= '0'))
+                                       {
+                                               $this->redirect_to = 
$GLOBALS['phpgw']->link(
+                                                       '/index.php',
+                                                        
'menuaction=email.uimessage.message'
+                                                       
.'&'.$nav_data['prev_msg']['msgball']['uri']
+                                                       
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
+                                                       
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
+                                                       
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
+                                       }
+                                       else
+                                       {
+                                               // go back to index page
+                                               $this->redirect_to = 
$GLOBALS['phpgw']->link(
+                                                       '/index.php',
+                                                        
'menuaction=email.uiindex.index'
+                                                       
.'&fldball[folder]='.$GLOBALS['phpgw']->msg->prep_folder_out($delmov_list[0]['folder'])
+                                                       
.'&fldball[acctnum]='.(int)$delmov_list[0]['acctnum']
+                                                       
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
+                                                       
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
+                                                       
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
+                                       }
+                                       if ($this->debug > 1) { echo 
'emai.boaction.delmov: move single *called by uimessage*: pre-move 
determination of $this->redirect_to : ['.$this->redirect_to.']<br>'; }
+                               }
+                               
                                $to_fldball = 
$GLOBALS['phpgw']->msg->get_arg_value('to_fldball');
                                $to_fldball['folder'] = 
$GLOBALS['phpgw']->msg->prep_folder_in($to_fldball['folder']);
***************
*** 139,165 ****
                                $tf = 
$GLOBALS['phpgw']->msg->prep_folder_out($to_fldball['folder']);
                                // folder we should go back to
!                               $return_to_fldball['folder'] = 
$GLOBALS['phpgw']->msg->prep_folder_out($delmov_list[0]['folder']);
!                               $return_to_fldball['acctnum'] = 
$delmov_list[0]['acctnum'];
!                               
!                               $this->redirect_to = $GLOBALS['phpgw']->link(
!                                                               '/index.php',
!                                                                
'menuaction=email.uiindex.index'
!                                                               
.'&fldball[folder]='.$return_to_fldball['folder']
!                                                               
.'&fldball[acctnum]='.$return_to_fldball['acctnum']
!                                                               .'&tm='.$tm
!                                                               .'&tf='.$tf
!                                                               
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
!                                                               
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
!                                                               
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                               
!                               $goto_args=array( 
!                                       'folder'  => 
$return_to_fldball['folder'],
!                                       'acctnum' => 
$return_to_fldball['acctnum'],
!                                       'tm'    => $tm,
!                                       'tf'    => $tf,
!                                       'sort'  => 
$GLOBALS['phpgw']->msg->get_arg_value('sort'),
!                                       'order'  => 
$GLOBALS['phpgw']->msg->get_arg_value('order'),
!                                       'start'  => 
$GLOBALS['phpgw']->msg->get_arg_value('start')
!                               );
                                // end session if we are not going to reuse the 
current object
                                if ($attempt_reuse == False)
--- 184,218 ----
                                $tf = 
$GLOBALS['phpgw']->msg->prep_folder_out($to_fldball['folder']);
                                // folder we should go back to
!                               if ((isset($delmov_list[0]['called_by']))
!                               && ($delmov_list[0]['called_by'] == 
'uimessage'))
!                               {
!                                       // we already figured this out before 
the move
!                               }
!                               else
!                               {
!                                       $return_to_fldball['folder'] = 
$GLOBALS['phpgw']->msg->prep_folder_out($delmov_list[0]['folder']);
!                                       $return_to_fldball['acctnum'] = 
$delmov_list[0]['acctnum'];
!                                       
!                                       $this->redirect_to = 
$GLOBALS['phpgw']->link(
!                                                                       
'/index.php',
!                                                                        
'menuaction=email.uiindex.index'
!                                                                       
.'&fldball[folder]='.$return_to_fldball['folder']
!                                                                       
.'&fldball[acctnum]='.$return_to_fldball['acctnum']
!                                                                       
.'&tm='.$tm
!                                                                       
.'&tf='.$tf
!                                                                       
.'&sort='.$GLOBALS['phpgw']->msg->get_arg_value('sort')
!                                                                       
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
!                                                                       
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                                       
!                                       $goto_args=array( 
!                                               'folder'  => 
$return_to_fldball['folder'],
!                                               'acctnum' => 
$return_to_fldball['acctnum'],
!                                               'tm'    => $tm,
!                                               'tf'    => $tf,
!                                               'sort'  => 
$GLOBALS['phpgw']->msg->get_arg_value('sort'),
!                                               'order'  => 
$GLOBALS['phpgw']->msg->get_arg_value('order'),
!                                               'start'  => 
$GLOBALS['phpgw']->msg->get_arg_value('start')
!                                       );
!                               }
                                // end session if we are not going to reuse the 
current object
                                if ($attempt_reuse == False)
***************
*** 375,395 ****
                        //echo '$GLOBALS[phpgw]->msg->get_arg_value(encoding): 
['.$GLOBALS['phpgw']->msg->get_arg_value('encoding').']<br>';
                        
!                       if ($GLOBALS['phpgw']->msg->get_arg_value('encoding') 
== 'base64')
                        {
-                               //echo 
$GLOBALS['phpgw']->msg->de_base64($GLOBALS['phpgw']->msg->phpgw_fetchbody($part_no));
                                echo 
$GLOBALS['phpgw']->msg->de_base64($GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball));
                        }
                        elseif 
($GLOBALS['phpgw']->msg->get_arg_value('encoding') == 'qprint')
                        {
-                               //echo 
$GLOBALS['phpgw']->msg->qprint($GLOBALS['phpgw']->msg->phpgw_fetchbody($part_no));
                                echo 
$GLOBALS['phpgw']->msg->qprint($GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball));
                        }
                        else
                        {
-                               //echo 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($part_no);
                                echo 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball);
                        }
!                       
!                       $GLOBALS['phpgw']->msg->end_request();
                        $GLOBALS['phpgw']->common->phpgw_footer();
                }
--- 428,459 ----
                        //echo '$GLOBALS[phpgw]->msg->get_arg_value(encoding): 
['.$GLOBALS['phpgw']->msg->get_arg_value('encoding').']<br>';
                        
!                       // ----  'irregular' "view raw message" functionality  
----
!                       if ($msgball['part_no'] == 'raw_message')
!                       {
!                               // to dump out the whole raw message, do this:
!                               // 1) output the headers, 2) output the raw 
body 3) output a "closing" CRLF
!                               //headers_msgball will be used get the message 
headers, by specifying "part_no" = 0
!                               $headers_msgball = $msgball;
!                               $headers_msgball['part_no'] = 0;
!                               // that can also be used to ge tthe raw message 
body because phpgw_body() doesn't care about "part_no" 
!                               echo 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($headers_msgball);
!                               echo 
$GLOBALS['phpgw']->msg->phpgw_body($headers_msgball);
!                               echo "\r\n";
!                       }
!                       // ---- "regular" attachment handling  ----
!                       elseif 
($GLOBALS['phpgw']->msg->get_arg_value('encoding') == 'base64')
                        {
                                echo 
$GLOBALS['phpgw']->msg->de_base64($GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball));
                        }
                        elseif 
($GLOBALS['phpgw']->msg->get_arg_value('encoding') == 'qprint')
                        {
                                echo 
$GLOBALS['phpgw']->msg->qprint($GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball));
                        }
                        else
                        {
                                echo 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball);
                        }
!                       // you may feed "end_request" a msgball or a fldball 
and "end_request" will close the acctnum specified therein
!                       $GLOBALS['phpgw']->msg->end_request($msgball);
                        $GLOBALS['phpgw']->common->phpgw_footer();
                }

Index: class.bocompose.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bocompose.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.bocompose.inc.php     8 Jan 2002 15:06:03 -0000       1.1
--- class.bocompose.inc.php     14 Jan 2002 20:51:37 -0000      1.2
***************
*** 459,462 ****
--- 459,467 ----
                        $this->xi['to_box_value'] = $to_box_value;
                        $this->xi['cc_box_value'] = $cc_box_value;
+                       // FUTURE: when we do spell check or message GPG 
encoding, we may need to submit whatever is in 
+                       // the bcc box (along with the other filled in data) 
simply so we can re-display this same page with 
+                       // spell checked or encoded message text
+                       $bcc_box_value = '';
+                       $this->xi['bcc_box_value'] = $bcc_box_value;
                        $this->xi['subject'] = $subject;
                        $this->xi['body'] = $body;
***************
*** 478,481 ****
--- 483,488 ----
                        $this->xi['cc_box_desc'] = lang('cc');
                        $this->xi['cc_box_name'] = 'cc';
+                       $this->xi['bcc_box_desc'] = lang('bcc');
+                       $this->xi['bcc_box_name'] = 'bcc';
                        $this->xi['subj_box_desc'] = lang('subject');
                        $this->xi['subj_box_name'] = 'subject';

Index: class.boindex.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.boindex.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** class.boindex.inc.php       11 Jan 2002 10:39:27 -0000      1.20
--- class.boindex.inc.php       14 Jan 2002 20:51:37 -0000      1.21
***************
*** 141,150 ****
                                'lang_email_date'       => lang('Email Date'),
                                'lang_arrival_date'     => lang('Arrival Date'),
!                               'lang_from'             => lang('From'),
                                'lang_subject'          => lang('Subject'),
!                               'lang_size'             => lang('Size'),
                                // folder stats Information bar
!                               'lang_new'              => lang('New'),
!                               'lang_new2'             => lang('New Messages'),
                                'lang_total'            => lang('Total'),
                                'lang_total2'           => lang('Total 
Messages'),
--- 141,150 ----
                                'lang_email_date'       => lang('Email Date'),
                                'lang_arrival_date'     => lang('Arrival Date'),
!                               'lang_from'                     => lang('From'),
                                'lang_subject'          => lang('Subject'),
!                               'lang_size'                     => lang('Size'),
                                // folder stats Information bar
!                               'lang_new'                      => lang('New'),
!                               'lang_new2'                     => lang('New 
Messages'),
                                'lang_total'            => lang('Total'),
                                'lang_total2'           => lang('Total 
Messages'),
***************
*** 152,156 ****
                                'stats_to_txt'          => lang('to'),
                                'lang_get_size'         => lang('get size'),
!                               'lang_date'             => lang('date'),
                                'lang_lines'            => lang('lines'),
                                'lang_counld_not_open'  => lang('Could not open 
this mailbox'),
--- 152,156 ----
                                'stats_to_txt'          => lang('to'),
                                'lang_get_size'         => lang('get size'),
!                               'lang_date'                     => lang('date'),
                                'lang_lines'            => lang('lines'),
                                'lang_counld_not_open'  => lang('Could not open 
this mailbox'),
***************
*** 262,266 ****
                        
                        // establish all manner of important data
!                       // can not put acctnum=X here because any single peice 
of data may apply to a different account
                        $this->xi['svr_image_dir'] = PHPGW_IMAGES_DIR;
                        $this->xi['image_dir'] = PHPGW_IMAGES;
--- 262,266 ----
                        
                        // establish all manner of important data
!                       // can not put acctnum=X here because any single piece 
of data may apply to a different account
                        $this->xi['svr_image_dir'] = PHPGW_IMAGES_DIR;
                        $this->xi['image_dir'] = PHPGW_IMAGES;
***************
*** 430,433 ****
--- 430,434 ----
                        }
                        
+                       // DEPRECIATED
                        $this->xi['ctrl_bar_acct_0_link'] = 
$GLOBALS['phpgw']->link(
                                                                '/index.php',
***************
*** 441,444 ****
--- 442,446 ----
                        $this->xi['ctrl_bar_acct_0_link'] = '<a 
href="'.$this->xi['ctrl_bar_acct_0_link'].'">'.'goto default'.'</a>';
                        
+                       // DEPRECIATED
                        $this->xi['ctrl_bar_acct_1_link'] = 
$GLOBALS['phpgw']->link(
                                                                '/index.php',

Index: class.bomessage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bomessage.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.bomessage.inc.php     11 Jan 2002 06:10:32 -0000      1.5
--- class.bomessage.inc.php     14 Jan 2002 20:51:37 -0000      1.6
***************
*** 22,25 ****
--- 22,26 ----
                var $nextmatchs;
                var $debug = 0;
+               //var $debug = 3;
                var $xi;
                var $part_nice = '';
***************
*** 46,51 ****
                        // attempt (or not) to reuse an existing mail_msg 
object, i.e. if one ALREADY exists before entering
                        // this function. As of Dec 14, 2001 only 
class.boaction can pass a useful, existing object for us to use here
!                       $attempt_reuse = True;
!                       //$attempt_reuse = False;
                        
                        if ($this->debug > 0) { echo 'ENTERING: 
email.bomessage.message_data'.'<br>'; }
--- 47,52 ----
                        // attempt (or not) to reuse an existing mail_msg 
object, i.e. if one ALREADY exists before entering
                        // this function. As of Dec 14, 2001 only 
class.boaction can pass a useful, existing object for us to use here
!                       //$attempt_reuse = True;
!                       $attempt_reuse = False;
                        
                        if ($this->debug > 0) { echo 'ENTERING: 
email.bomessage.message_data'.'<br>'; }
***************
*** 97,105 ****
                        // ---- BEGIN BOMESSAGE ----
                        
                        // ----  Fill Some Important Variables  -----
                        $svr_image_dir = PHPGW_IMAGES_DIR;
                        $image_dir = PHPGW_IMAGES;
!                       $sm_envelope_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir.'/sm_envelope.gif','Add to 
address book','8','10','0');
!                       //$default_sorting = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['default_sorting'];
                        $not_set = $GLOBALS['phpgw']->msg->not_set;
                        
--- 98,209 ----
                        // ---- BEGIN BOMESSAGE ----
                        
+                       // ---- LANGS ----
+                       $this->xi['lang_add_to_address_book'] = lang('Add to 
address book');
+                       $this->xi['lang_previous_message'] = lang('Previous 
Message');
+                       $this->xi['lang_no_previous_message'] = lang('No 
Previous Message');
+                       $this->xi['lang_next_message'] = lang('Next Message');  
        
+                       $this->xi['lang_no_next_message'] = lang('No Next 
Message');
+                       $this->xi['lang_from'] = lang('from');
+                       $this->xi['lang_to'] = lang('to');
+                       $this->xi['lang_cc'] = lang('cc');
+                       $this->xi['lang_date'] = lang('date');
+                       $this->xi['lang_files'] = lang('files');
+                       $this->xi['lang_subject'] = lang('subject');
+                       $this->xi['lang_undisclosed_sender'] = 
lang('Undisclosed Sender');                      
+                       $this->xi['lang_undisclosed_recipients'] = 
lang('Undisclosed Recipients');
+                       $this->xi['lang_reply'] = lang('reply');
+                       $this->xi['lang_reply_all'] = lang('reply all');
+                       $this->xi['lang_forward'] = lang('forward');
+                       $this->xi['lang_delete'] = lang('delete');
+                       $this->xi['lang_view_headers'] = lang('view headers');
+                       $this->xi['lang_view_raw_message'] = lang('raw 
message');
+                       $this->xi['lang_message'] = lang('message');
+                       $this->xi['lang_keywords'] = lang('keywords');
+                       $this->xi['lang_section'] = lang('section');
+                       $this->xi['lang_view_as_html'] = lang('View as HTML');
+                       $this->xi['lang_view_formatted'] = lang('view 
formatted');
+                       $this->xi['lang_view_unformatted'] = lang('view 
unformatted');
+                       $this->xi['lang_charset'] = lang('charset');
+                       $this->xi['lang_attachment'] = lang('Attachment');
+                       $this->xi['lang_size'] = lang('size');
+                       $this->xi['lang_error_unknown_message_data'] = 
lang('ERROR: Unknown Message Data');
+                       $this->xi['accounts_label'] = lang('Switch Accounts');
+                       $this->xi['lang_move_this_message_into'] = lang('Move 
This Message into');
+                       
+                       
+                       //  ----  TOOL BAR / MENU BAR ----
+                       $this->xi['ctrl_bar_font'] = 
$GLOBALS['phpgw_info']['theme']['font'];
+                       $this->xi['ctrl_bar_font_size'] =  '-1';
+                       $this->xi['ctrl_bar_back1'] = 
$GLOBALS['phpgw_info']['theme']['row_on'];
+                       // pass on (preserve these valus) after the message move
+                       $this->xi['current_sort'] = 
$GLOBALS['phpgw']->msg->get_arg_value('sort');
+                       $this->xi['current_order'] = 
$GLOBALS['phpgw']->msg->get_arg_value('order');
+                       $this->xi['current_start'] = 
$GLOBALS['phpgw']->msg->get_arg_value('start');
+                       // ---- account switchbox  ----
+                       // make a HTML comobox used to switch accounts
+                       $make_acctbox = True;
+                       //$make_acctbox = False;
+                       // borrow code from boindex and uiindex for this 
functionality
+                       if ($make_acctbox)
+                       {
+                               $feed_args = Array(
+                                       'pre_select_acctnum'    => 
$GLOBALS['phpgw']->msg->get_acctnum(),
+                                       'widget_name'           => 
'fldball_fake_uri',
+                                       'folder_key_name'       => 'folder',
+                                       'acctnum_key_name'      => 'acctnum',
+                                       'on_change'             => 
'document.acctbox.submit()'
+                               );
+                               $this->xi['acctbox_listbox'] = 
$GLOBALS['phpgw']->msg->all_ex_accounts_listbox($feed_args);
+                       }
+                       else
+                       {
+                               $this->xi['acctbox_listbox'] = '&nbsp';
+                       }
+                       $this->xi['acctbox_frm_name'] = 'acctbox';
+                       // switchbox will itself contain "fake_uri" embedded 
data which includes the applicable account number for the folder
+                       $this->xi['acctbox_action'] = $GLOBALS['phpgw']->link(
+                                                               '/index.php',
+                                                                
'menuaction=email.uiindex.index');
+                       
+                       // ---- Move Message Box  ----
+                       // borrow code from boindex and uiindex for this 
functionality
+                       $this->xi['mlist_checkbox_name'] = 'delmov_list[]';
+                       
+                       $this->xi['frm_delmov_action'] = 
$GLOBALS['phpgw']->link(
+                                                               '/index.php',
+                                                               
'menuaction=email.boaction.delmov');
+                       $this->xi['frm_delmov_name'] = 'delmov';
+                       $this->xi['mlist_embedded_uri'] = 
$GLOBALS['phpgw']->msg->get_arg_value('["msgball"]["uri"]');
+                       // add a special flag to the uri to indicate we should 
goto the next message, not to the index page
+                       $this->xi['mlist_embedded_uri'] .= 
'&msgball[called_by]=uimessage';
+                       $this->xi['mailsvr_supports_folders'] = 
$GLOBALS['phpgw']->msg->get_mailsvr_supports_folders();
+                       if ($this->xi['mailsvr_supports_folders'])
+                       {
+                               $feed_args = Array();
+                               $feed_args = Array(
+                                       'mailsvr_stream'        => '',
+                                       'pre_select_folder'     => '',
+                                       'skip_folder'           => 
$GLOBALS['phpgw']->msg->get_folder_short($GLOBALS['phpgw']->msg->get_arg_value('folder')),
+                                       'show_num_new'          => False,
+                                       'widget_name'           => 
'to_fldball_fake_uri',
+                                       'folder_key_name'       => 'folder',
+                                       'acctnum_key_name'      => 'acctnum',
+                                       'on_change'             => 
'do_action(\'move\')',
+                                       'first_line_txt'        => 
$this->xi['lang_move_this_message_into']
+                               );
+                               $this->xi['delmov_listbox'] = 
$GLOBALS['phpgw']->msg->all_folders_listbox($feed_args);
+                       }
+                       else
+                       {
+                               $this->xi['delmov_listbox'] = '&nbsp;';
+                       }
+                       
+                       
+                       
+                       
                        // ----  Fill Some Important Variables  -----
                        $svr_image_dir = PHPGW_IMAGES_DIR;
                        $image_dir = PHPGW_IMAGES;
!                       $sm_envelope_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir.'/sm_envelope.gif',$this->xi['lang_add_to_address_book'],'8','10','0');
                        $not_set = $GLOBALS['phpgw']->msg->not_set;
                        
***************
*** 116,119 ****
--- 220,224 ----
                        $message_date = 
$GLOBALS['phpgw']->common->show_date($msg_headers->udate);
                        
+                       if ($this->debug > 2) { echo 
'class.bomessage.message_data: $msg_struct DUMP:<pre>'; print_r($msg_struct); 
echo '</pre>';  }
                        #set_time_limit(0);
                        
***************
*** 161,165 ****
                        {
                                $prev_msg_link = $GLOBALS['phpgw']->link(
-                                       // 
'/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/message.php',
                                        '/index.php',
                                         'menuaction=email.uimessage.message'
--- 266,269 ----
***************
*** 168,178 ****
                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                               $prev_msg_img = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/left.gif',lang('Previous 
Message'),'','','0');
                                $ilnk_prev_msg = 
$GLOBALS['phpgw']->msg->href_maketag($prev_msg_link,$prev_msg_img);
                        }
                        else
                        {
!                               //if ($this->debug > 0) { echo 'messages.php 
'.lang('No Previous Message').'<br>'; }
!                               $ilnk_prev_msg = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/left-grey.gif',lang('No 
Previous Message'),'','','0');
                        }
                        
--- 272,281 ----
                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                               $prev_msg_img = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/left.gif',$this->xi['lang_previous_message'],'','','0');
                                $ilnk_prev_msg = 
$GLOBALS['phpgw']->msg->href_maketag($prev_msg_link,$prev_msg_img);
                        }
                        else
                        {
!                               $ilnk_prev_msg = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/left-grey.gif',$this->xi['lang_no_previous_message'],'','','0');
                        }
                        
***************
*** 183,187 ****
                        {
                                $next_msg_link = $GLOBALS['phpgw']->link(
- //                                     
'/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/message.php',
                                        '/index.php',
                                         'menuaction=email.uimessage.message'
--- 286,289 ----
***************
*** 190,200 ****
                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                               $next_msg_img = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/right.gif',lang('Next 
Message'),'','','0');
                                $ilnk_next_msg = 
$GLOBALS['phpgw']->msg->href_maketag($next_msg_link,$next_msg_img);
                        }
                        else
                        {
!                               //if ($this->debug > 0) { echo 'messages.php 
'.lang('No Next Message').'<br>'; }
!                               $ilnk_next_msg = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/right-grey.gif',lang('No 
Next Message'),'','','0');
                        }
                        
--- 292,301 ----
                                        
.'&order='.$GLOBALS['phpgw']->msg->get_arg_value('order')
                                        
.'&start='.$GLOBALS['phpgw']->msg->get_arg_value('start'));
!                               $next_msg_img = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/right.gif',$this->xi['lang_next_message'],'','','0');
                                $ilnk_next_msg = 
$GLOBALS['phpgw']->msg->href_maketag($next_msg_link,$next_msg_img);
                        }
                        else
                        {
!                               $ilnk_next_msg = 
$GLOBALS['phpgw']->msg->img_maketag($svr_image_dir.'/right-grey.gif',$this->xi['lang_no_next_message'],'','','0');
                        }
                        
***************
*** 208,223 ****
                        $this->xi['tofrom_data_bkcolor'] = 
$GLOBALS['phpgw_info']['theme']['row_on'];
                        
-                       $this->xi['lang_from'] = lang('from');
-                       $this->xi['lang_to'] = lang('to');
-                       $this->xi['lang_cc'] = lang('cc');
-                       $this->xi['lang_date'] = lang('date');
-                       $this->xi['lang_files'] = lang('files');
-                       $this->xi['lang_subject'] = lang('subject');
-                       
                        // ----  From: Message Data  -----
                        if (!$msg_headers->from)
                        {
                                // no header info about this sender is available
!                               $from_data_final = lang('Undisclosed Sender');
                        }
                        else
--- 309,317 ----
                        $this->xi['tofrom_data_bkcolor'] = 
$GLOBALS['phpgw_info']['theme']['row_on'];
                        
                        // ----  From: Message Data  -----
                        if (!$msg_headers->from)
                        {
                                // no header info about this sender is available
!                               $from_data_final = 
$this->xi['lang_undisclosed_sender'];
                        }
                        else
***************
*** 239,244 ****
                                }
                                // display "From" according to user preferences
-                               //if 
(isset($GLOBALS['phpgw_info']['user']['preferences']['email']['show_addresses'])
-                               //&& 
($GLOBALS['phpgw_info']['user']['preferences']['email']['show_addresses'] != 
'none')
                                if 
(($GLOBALS['phpgw']->msg->get_isset_pref('show_addresses'))
                                && 
($GLOBALS['phpgw']->msg->get_pref_value('show_addresses') != 'none')
--- 333,336 ----
***************
*** 259,264 ****
                                                '/index.php',
                                                 
'menuaction=email.uicompose.compose'
!                                                // DO NOT USE msgball - bosend 
will interpret this the wrong way
!                                               //.'&'.$msgball['uri']
                                                
.'&fldball[folder]='.$msgball['folder']
                                                
.'&fldball[acctnum]='.$msgball['acctnum']
--- 351,355 ----
                                                '/index.php',
                                                 
'menuaction=email.uicompose.compose'
!                                                // DO NOT USE msgball[] - 
bosend will interpret this incorrectly as a reply or forward
                                                
.'&fldball[folder]='.$msgball['folder']
                                                
.'&fldball[acctnum]='.$msgball['acctnum']
***************
*** 291,295 ****
                        if (!$msg_headers->to)
                        {
!                               $to_data_final = lang('Undisclosed Recipients');
                        }
                        else
--- 382,386 ----
                        if (!$msg_headers->to)
                        {
!                               $to_data_final = 
$this->xi['lang_undisclosed_recipients'];
                        }
                        else
***************
*** 307,311 ****
                                                $to_personal = 
$GLOBALS['phpgw']->msg->decode_header_string($topeople->personal);
                                        }
-                                       //if 
(($GLOBALS['phpgw_info']['user']['preferences']['email']['show_addresses'] != 
'none')
                                        if 
(($GLOBALS['phpgw']->msg->get_pref_value('show_addresses') != 'none')
                                        && ($to_personal != $to_plain))
--- 398,401 ----
***************
*** 322,327 ****
                                                        '/index.php',
                                                         
'menuaction=email.uicompose.compose'
!                                                       // DO NOT USE msgball - 
bosend will interpret this the wrong way
!                                                       //.'&'.$msgball['uri']
                                                        
.'&fldball[folder]='.$msgball['folder']
                                                        
.'&fldball[acctnum]='.$msgball['acctnum']
--- 412,416 ----
                                                        '/index.php',
                                                         
'menuaction=email.uicompose.compose'
!                                                       // DO NOT USE msgball[] 
- bosend will interpret this incorrectly as a reply or forward
                                                        
.'&fldball[folder]='.$msgball['folder']
                                                        
.'&fldball[acctnum]='.$msgball['acctnum']
***************
*** 489,493 ****
                        
                        // ----  Images and Hrefs For Reply, ReplyAll, Forward, 
and Delete  -----
!                       $reply_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir.'/sm_reply.gif',lang('reply'),'','','0');
                        $reply_url = $GLOBALS['phpgw']->link(
                                        '/index.php',
--- 578,582 ----
                        
                        // ----  Images and Hrefs For Reply, ReplyAll, Forward, 
and Delete  -----
!                       $reply_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir.'/sm_reply.gif',$this->xi['lang_reply'],'','','0');
                        $reply_url = $GLOBALS['phpgw']->link(
                                        '/index.php',
***************
*** 502,506 ****
                        $ilnk_reply = 
$GLOBALS['phpgw']->msg->href_maketag($reply_url, $reply_img);
                        
!                       $replyall_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir .'/sm_reply_all.gif',lang('reply 
all'),'','','0');
                        $replyall_url = $GLOBALS['phpgw']->link(
                                        '/index.php',
--- 591,595 ----
                        $ilnk_reply = 
$GLOBALS['phpgw']->msg->href_maketag($reply_url, $reply_img);
                        
!                       $replyall_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir 
.'/sm_reply_all.gif',$this->xi['lang_reply_all'],'','','0');
                        $replyall_url = $GLOBALS['phpgw']->link(
                                        '/index.php',
***************
*** 515,519 ****
                        $ilnk_replyall = 
$GLOBALS['phpgw']->msg->href_maketag($replyall_url, $replyall_img);
                        
!                       $forward_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir 
.'/sm_forward.gif',lang('forward'),'','','0');
                        $forward_url =  $GLOBALS['phpgw']->link(
                                        '/index.php',
--- 604,608 ----
                        $ilnk_replyall = 
$GLOBALS['phpgw']->msg->href_maketag($replyall_url, $replyall_img);
                        
!                       $forward_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir 
.'/sm_forward.gif',$this->xi['lang_forward'],'','','0');
                        $forward_url =  $GLOBALS['phpgw']->link(
                                        '/index.php',
***************
*** 529,533 ****
                        $ilnk_forward = 
$GLOBALS['phpgw']->msg->href_maketag($forward_url, $forward_img);
                        
!                       $delete_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir 
.'/sm_delete.gif',lang('delete'),'','','0');
                        $delete_url = $GLOBALS['phpgw']->link(
                                         '/index.php',
--- 618,622 ----
                        $ilnk_forward = 
$GLOBALS['phpgw']->msg->href_maketag($forward_url, $forward_img);
                        
!                       $delete_img = 
$GLOBALS['phpgw']->msg->img_maketag($image_dir 
.'/sm_delete.gif',$this->xi['lang_delete'],'','','0');
                        $delete_url = $GLOBALS['phpgw']->link(
                                         '/index.php',
***************
*** 641,652 ****
                                                }
                                        }
!                                       if 
($this->part_nice[$i]['ex_num_subparts'] != $not_set)
                                        {
!                                               $msg_body_info .= 
'ex_num_subparts: '. $this->part_nice[$i]['ex_num_subparts'] .$crlf;
!                                               if 
(strlen($this->part_nice[$i]['m_part_num_mime']) > 2)
                                                {
!                                                       $msg_body_info .= 
'subpart: '. serialize($this->part_nice[$i]['subpart']) .$crlf;
                                                }
                                        }
                                        if 
($this->part_nice[$i]['ex_attachment'])
                                        {
--- 730,748 ----
                                                }
                                        }
!                                       if 
($this->part_nice[$i]['ex_num_dparam_pairs'] > 0)
                                        {
!                                               for ($p = 0; $p < 
$this->part_nice[$i]['ex_num_dparam_pairs']; $p++)
                                                {
!                                                       $msg_body_info .= 
'dparams['.$p.']: 
'.$this->part_nice[$i]['dparams'][$p]['attribute'].'='.$this->part_nice[$i]['dparams'][$p]['value']
 .$crlf;
                                                }
                                        }
+                                       if 
($this->part_nice[$i]['ex_num_subparts'] != $not_set)
+                                       {
+                                               $msg_body_info .= 
'ex_num_subparts: '. $this->part_nice[$i]['ex_num_subparts'] .$crlf;
+                                               //if 
(strlen($this->part_nice[$i]['m_part_num_mime']) > 2)
+                                               //{
+                                               //      $msg_body_info .= 
'subpart: '. serialize($this->part_nice[$i]['subpart']) .$crlf;
+                                               //}
+                                       }
                                        if 
($this->part_nice[$i]['ex_attachment'])
                                        {
***************
*** 704,711 ****
                                .'&encoding=7bit'
                                );
!                       //$view_headers_href = 
$GLOBALS['phpgw']->msg->href_maketag($view_headers_url, lang('view headers'));
!                       $view_headers_href = '<a href="'.$view_headers_url.'" 
target="new">'.lang('view headers').'</a>';
                        $this->xi['view_headers_href'] = $view_headers_href;
                        
                        // Force Echo Out Unformatted Text for email with 1 
part which is a large text messages (in bytes) , such as a system report from 
cron
                        // php (4.0.4pl1 last tested) and some imap servers 
(courier and uw-imap are confirmed) will time out retrieving this type of 
message
--- 800,822 ----
                                .'&encoding=7bit'
                                );
!                       
!                       $view_headers_href = '<a href="'.$view_headers_url.'" 
target="new">'.$this->xi['lang_view_headers'].'</a>';
                        $this->xi['view_headers_href'] = $view_headers_href;
                        
+                       // (3) view or download the raw message, including 
headers
+                       $this_msgball = $msgball;
+                       $this_msgball['part_no'] = 'raw_message';
+                       $view_raw_message_url = $GLOBALS['phpgw']->link(
+                                '/index.php',
+                               'menuaction=email.boaction.get_attach'
+                               
.'&'.$msgball['uri'].'&msgball[part_no]='.$this_msgball['part_no']
+                               .'&type=text'
+                               .'&subtype=plain'
+                               .'&name=raw_message.txt'
+                               .'&encoding=7bit'
+                               );
+                       $view_raw_message_href = '<a 
href="'.$view_raw_message_url.'" 
target="new">'.$this->xi['lang_view_raw_message'].'</a>';
+                       $this->xi['view_raw_message_href'] = 
$view_raw_message_href;
+                       
                        // Force Echo Out Unformatted Text for email with 1 
part which is a large text messages (in bytes) , such as a system report from 
cron
                        // php (4.0.4pl1 last tested) and some imap servers 
(courier and uw-imap are confirmed) will time out retrieving this type of 
message
***************
*** 774,778 ****
                                        $title_text = '&nbsp;Mime-Ignorant 
Email Server: ';
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
!                                       $display_str = lang('keywords').': 
'.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
                                        
--- 885,889 ----
                                        $title_text = '&nbsp;Mime-Ignorant 
Email Server: ';
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
!                                       $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
                                        
***************
*** 831,836 ****
                                && ((int)$this->part_nice[$i]['bytes'] > 
$force_echo_size))
                                {
!                                       $title_text = 
'&nbsp;'.lang('message').': ';
!                                       $display_str = lang('keywords').': 
'.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size($this->part_nice[$i]['bytes'])
                                                .'; meets force_echo 
('.$GLOBALS['phpgw']->msg->format_byte_size($force_echo_size).') criteria';
                                        
--- 942,947 ----
                                && ((int)$this->part_nice[$i]['bytes'] > 
$force_echo_size))
                                {
!                                       $title_text = 
'&nbsp;'.$this->xi['lang_message'].': ';
!                                       $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size($this->part_nice[$i]['bytes'])
                                                .'; meets force_echo 
('.$GLOBALS['phpgw']->msg->format_byte_size($force_echo_size).') criteria';
                                        
***************
*** 852,858 ****
                                        
                                        // -----  Prepare a Table for this Echo 
Dump
!                                       $title_text = 
'&nbsp;'.lang('message').': ';
                                        
$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
!                                       $display_str = lang('keywords').': 
'.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size($this->part_nice[$i]['bytes'])
                                                .'; meets force_echo 
('.$GLOBALS['phpgw']->msg->format_byte_size($force_echo_size).') criteria';
                                        
$GLOBALS['phpgw']->template->set_var('display_str',$display_str);
--- 963,969 ----
                                        
                                        // -----  Prepare a Table for this Echo 
Dump
!                                       $title_text = 
'&nbsp;'.$this->xi['lang_message'].': ';
                                        
$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
!                                       $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords'].' - 
'.$GLOBALS['phpgw']->msg->format_byte_size($this->part_nice[$i]['bytes'])
                                                .'; meets force_echo 
('.$GLOBALS['phpgw']->msg->format_byte_size($force_echo_size).') criteria';
                                        
$GLOBALS['phpgw']->template->set_var('display_str',$display_str);
***************
*** 891,903 ****
                                        if ($count_part_nice > 2)
                                        {
!                                               $title_text = 
lang('section').': '.$this->part_nice[$i]['m_part_num_mime'];
                                        }
                                        else
                                        {
!                                               $title_text = 
'&nbsp;'.lang('message').': ';
                                        }
                                        
                                        //$display_str = 
$this->part_nice[$i]['type'].'/'.strtolower($this->part_nice[$i]['subtype']);
!                                       $display_str = lang('keywords').': 
'.$this->part_nice[$i]['m_keywords']
                                                .' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
--- 1002,1014 ----
                                        if ($count_part_nice > 2)
                                        {
!                                               $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
                                        }
                                        else
                                        {
!                                               $title_text = 
'&nbsp;'.$this->xi['lang_message'].': ';
                                        }
                                        
                                        //$display_str = 
$this->part_nice[$i]['type'].'/'.strtolower($this->part_nice[$i]['subtype']);
!                                       $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords']
                                                .' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
***************
*** 981,985 ****
                                                                .'<input 
type="hidden" name="html_part" value="'.base64_encode($dsp).'">'."\r\n"
                                                                .'&nbsp;&nbsp;'
!                                                               .'<input 
type="submit" value="'.lang('View as HTML').'">'."\r\n"
                                                        .'</p>'
                                                        .'<br>';
--- 1092,1096 ----
                                                                .'<input 
type="hidden" name="html_part" value="'.base64_encode($dsp).'">'."\r\n"
                                                                .'&nbsp;&nbsp;'
!                                                               .'<input 
type="submit" value="'.$this->xi['lang_view_as_html'].'">'."\r\n"
                                                        .'</p>'
                                                        .'<br>';
***************
*** 1018,1022 ****
                                                                .'<input 
type="hidden" name="html_reference" value="'.$part_href.'">'."\r\n"
                                                                .'&nbsp;&nbsp;'
!                                                               .'<input 
type="submit" value="'.lang('View as HTML').'">'."\r\n"
                                                        .'</p>'
                                                        .'<br>';
--- 1129,1133 ----
                                                                .'<input 
type="hidden" name="html_reference" value="'.$part_href.'">'."\r\n"
                                                                .'&nbsp;&nbsp;'
!                                                               .'<input 
type="submit" value="'.$this->xi['lang_view_as_html'].'">'."\r\n"
                                                        .'</p>'
                                                        .'<br>';
***************
*** 1081,1085 ****
                                        {
                                                $skip_this_part = True;
-                                               
//$GLOBALS['phpgw']->template->set_var('V_display_part','');
                                                
$this->part_nice[$i]['title_text'] = '';
                                                
$this->part_nice[$i]['display_str'] = '';
--- 1192,1195 ----
***************
*** 1122,1134 ****
                                                        // how many chars to 
allow on any single line, if more then we ADD a CRLF and split the line
                                                        $wrap_text_at = 85;
!                                                       $dsp = 
$GLOBALS['phpgw']->msg->body_hard_wrap($dsp, $wrap_text_at);
                                                        $dsp = 
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($dsp);
                                                        $dsp = 
'<pre>'.$dsp.'</pre>';
                                                        // alternate (toggle) 
to view formatted
!                                                       $view_option = 
$GLOBALS['phpgw']->msg->href_maketag($view_option_url, lang('view formatted'));
                                                }
                                                else
                                                {
!                                                       if 
(strtoupper(lang('charset')) <> 'BIG5')
                                                        {
                                                                // before we 
can encode some chars into html entities (ex. change > to &gt;)
--- 1232,1244 ----
                                                        // how many chars to 
allow on any single line, if more then we ADD a CRLF and split the line
                                                        $wrap_text_at = 85;
!                                                       $dsp = 
$GLOBALS['phpgw']->msg->body_hard_wrap($dsp, $wrap_text_at) ."\r\n";
                                                        $dsp = 
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($dsp);
                                                        $dsp = 
'<pre>'.$dsp.'</pre>';
                                                        // alternate (toggle) 
to view formatted
!                                                       $view_option = 
$GLOBALS['phpgw']->msg->href_maketag($view_option_url, 
$this->xi['lang_view_formatted']);
                                                }
                                                else
                                                {
!                                                       if 
(strtoupper($this->xi['lang_charset']) <> 'BIG5')
                                                        {
                                                                // before we 
can encode some chars into html entities (ex. change > to &gt;)
***************
*** 1149,1153 ****
                                                        $dsp = $dsp .'<br><br>';
                                                        // alternate (toggle) 
to view unformatted, for this we add "&no_fmt=1" to the URL
!                                                       $view_option = 
$GLOBALS['phpgw']->msg->href_maketag($view_option_url.'&no_fmt=1', lang('view 
unformatted'));
                                                }
                                                
--- 1259,1263 ----
                                                        $dsp = $dsp .'<br><br>';
                                                        // alternate (toggle) 
to view unformatted, for this we add "&no_fmt=1" to the URL
!                                                       $view_option = 
$GLOBALS['phpgw']->msg->href_maketag($view_option_url.'&no_fmt=1', 
$this->xi['lang_view_unformatted']);
                                                }
                                                
***************
*** 1160,1172 ****
                                                if ($count_part_nice > 2)
                                                {
!                                                       $title_text = 
lang('section').': '.$this->part_nice[$i]['m_part_num_mime'];
                                                }
                                                else
                                                {
!                                                       $title_text = 
'&nbsp;'.lang('message').': ';
                                                }
                                                
//$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
                                                
$this->part_nice[$i]['title_text'] = $title_text;
!                                               $display_str = 
lang('keywords').': '.$this->part_nice[$i]['m_keywords']
                                                        .' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                                // View formatted / unformatted 
moved to toolbar, do not show it here
--- 1270,1282 ----
                                                if ($count_part_nice > 2)
                                                {
!                                                       $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
                                                }
                                                else
                                                {
!                                                       $title_text = 
'&nbsp;'.$this->xi['lang_message'].': ';
                                                }
                                                
//$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
                                                
$this->part_nice[$i]['title_text'] = $title_text;
!                                               $display_str = 
$this->xi['lang_keywords'].': '.$this->part_nice[$i]['m_keywords']
                                                        .' - 
'.$GLOBALS['phpgw']->msg->format_byte_size(strlen($dsp));
                                                // View formatted / unformatted 
moved to toolbar, do not show it here
***************
*** 1187,1194 ****
                                elseif ($this->part_nice[$i]['m_description'] 
== 'presentable/image')
                                {
!                                       $title_text = lang('section').': 
'.$this->part_nice[$i]['m_part_num_mime'];
                                        $display_str = 
$GLOBALS['phpgw']->msg->decode_header_string($this->part_nice[$i]['ex_part_name'])
                                                .' - ' 
.$GLOBALS['phpgw']->msg->format_byte_size((int)$this->part_nice[$i]['bytes']) 
!                                               .' - '.lang('keywords').': ' 
.$this->part_nice[$i]['m_keywords'];
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
--- 1297,1304 ----
                                elseif ($this->part_nice[$i]['m_description'] 
== 'presentable/image')
                                {
!                                       $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
                                        $display_str = 
$GLOBALS['phpgw']->msg->decode_header_string($this->part_nice[$i]['ex_part_name'])
                                                .' - ' 
.$GLOBALS['phpgw']->msg->format_byte_size((int)$this->part_nice[$i]['bytes']) 
!                                               .' - 
'.$this->xi['lang_keywords'].': ' .$this->part_nice[$i]['m_keywords'];
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
***************
*** 1207,1218 ****
                                elseif ($this->part_nice[$i]['m_description'] 
== 'attachment')
                                {
!                                       $title_text = lang('section').': 
'.$this->part_nice[$i]['m_part_num_mime'];
!                                       $display_str = lang('keywords').': ' 
.$this->part_nice[$i]['m_keywords'];
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
                                        
!                                       $msg_text = '&nbsp;&nbsp; 
<strong>'.lang('Attachment').':</strong>'
                                                .'&nbsp;&nbsp; 
'.$this->part_nice[$i]['ex_part_clickable']
!                                               .'&nbsp;&nbsp; 
'.lang('size').': 
'.$GLOBALS['phpgw']->msg->format_byte_size((int)$this->part_nice[$i]['bytes'])
                                                .'<br><br>';
                                        
--- 1317,1328 ----
                                elseif ($this->part_nice[$i]['m_description'] 
== 'attachment')
                                {
!                                       $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
!                                       $display_str = 
$this->xi['lang_keywords'].': ' .$this->part_nice[$i]['m_keywords'];
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
                                        $this->part_nice[$i]['display_str'] = 
$display_str;
                                        
!                                       $msg_text = '&nbsp;&nbsp; 
<strong>'.$this->xi['lang_attachment'].':</strong>'
                                                .'&nbsp;&nbsp; 
'.$this->part_nice[$i]['ex_part_clickable']
!                                               .'&nbsp;&nbsp; 
'.$this->xi['lang_size'].': 
'.$GLOBALS['phpgw']->msg->format_byte_size((int)$this->part_nice[$i]['bytes'])
                                                .'<br><br>';
                                        
***************
*** 1230,1236 ****
                                {
                                        // if we get here then we've got some 
kind of error, all things we know about are handle above
!                                       $title_text = lang("section").': 
'.$this->part_nice[$i]['m_part_num_mime'];
                                        $display_str = 
$GLOBALS['phpgw']->msg->decode_header_string($this->part_nice[$i]['ex_part_name'])
!                                               .' - '.lang('keywords').': ' 
.$this->part_nice[$i]['m_keywords'];
                                        
//$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
--- 1340,1346 ----
                                {
                                        // if we get here then we've got some 
kind of error, all things we know about are handle above
!                                       $title_text = 
$this->xi['lang_section'].': '.$this->part_nice[$i]['m_part_num_mime'];
                                        $display_str = 
$GLOBALS['phpgw']->msg->decode_header_string($this->part_nice[$i]['ex_part_name'])
!                                               .' - 
'.$this->xi['lang_keywords'].': ' .$this->part_nice[$i]['m_keywords'];
                                        
//$GLOBALS['phpgw']->template->set_var('title_text',$title_text);
                                        $this->part_nice[$i]['title_text'] = 
$title_text;
***************
*** 1240,1244 ****
                                        $msg_text = '';
                                        // UNKNOWN DATA
!                                       $msg_text = $msg_text 
.'<br><strong>'.lang('ERROR: Unknown Message Data').'</strong><br>';
                                        if ($this->part_nice[$i]['encoding'] == 
'base64')
                                        {
--- 1350,1354 ----
                                        $msg_text = '';
                                        // UNKNOWN DATA
!                                       $msg_text = $msg_text 
.'<br><strong>'.$this->xi['lang_error_unknown_message_data'].'</strong><br>';
                                        if ($this->part_nice[$i]['encoding'] == 
'base64')
                                        {

Index: class.bosend.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bosend.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.bosend.inc.php        10 Jan 2002 10:04:41 -0000      1.6
--- class.bosend.inc.php        14 Jan 2002 20:51:37 -0000      1.7
***************
*** 297,300 ****
--- 297,301 ----
                        
                        // ----  Attachment Detection  -----
+                       // some of this attachment uploading and handling code 
is from squirrelmail (www.squirrelmail.org)
                        $upload_dir = $GLOBALS['phpgw']->msg->att_files_dir;
                        if (file_exists($upload_dir))
***************
*** 325,328 ****
--- 326,330 ----
                        $to = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('to'));
                        $cc = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('cc'));
+                       $bcc = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('bcc'));
                        $body = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->get_arg_value('body')));
                        $subject = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($GLOBALS['phpgw']->msg->get_arg_value('subject'));
***************
*** 335,341 ****
                        // THIS NEEDS TO BE CHANGED WHEN MULTIPLE PART FORWARDS 
ARE ENABLED
                        // BECAUSE WE CAN ONLY ALTER THE 1ST PART, I.E. THE 
PART THE USER JUST TYPED IN
!                       /*  // I think the email needs to be sent out as if it 
were PLAIN text (at least the part we are handling here)
!                       // i.e. with NO ENCODED HTML ENTITIES, so use > instead 
of $rt; and " instead of &quot; . etc...
!                       // it's up to the endusers MUA to handle any 
htmlspecialchars, whether to encode them or leave as it, the MUA should decide  
*/
                        $body = 
$GLOBALS['phpgw']->msg->htmlspecialchars_decode($body);
                        
--- 337,344 ----
                        // THIS NEEDS TO BE CHANGED WHEN MULTIPLE PART FORWARDS 
ARE ENABLED
                        // BECAUSE WE CAN ONLY ALTER THE 1ST PART, I.E. THE 
PART THE USER JUST TYPED IN
!                       /*  email needs to be sent out as if it were PLAIN text 
(at least the part we are handling here)
!                       i.e. with NO ENCODED HTML ENTITIES, so use > instead of 
$rt; and " instead of &quot; . etc...
!                       it's up to the endusers MUA to handle any 
htmlspecialchars, whether to encode them or leave as it, the MUA should decide 
!                       */
                        $body = 
$GLOBALS['phpgw']->msg->htmlspecialchars_decode($body);
                        
***************
*** 368,371 ****
--- 371,381 ----
                                $mta_to .= ',' 
.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['cc'], False);
                        }
+                       if ($bcc)
+                       {
+                               // here we will add bcc addresses to the list 
of adresses we will feed the MTA via the "RCPT TO" command
+                               // *however* this bcc data NEVER actually gets 
put in the message headers
+                               $this->mail_out['bcc'] = 
$GLOBALS['phpgw']->msg->make_rfc_addy_array($bcc);
+                               $mta_to .= ',' 
.$GLOBALS['phpgw']->msg->addy_array_to_str($this->mail_out['bcc'], False);
+                       }
                        // now make mta_to an array because we will loop 
through it in class mail_send
                        $this->mail_out['mta_to'] = explode(',', $mta_to);
***************
*** 494,497 ****
--- 504,509 ----
                        {
                                // -----   INCOMPLETE CODE HERE  --------
+                               // -----   INCOMPLETE CODE HERE  --------
+                               // -----   INCOMPLETE CODE HERE  --------
                                $body_part_num++;
                                
$this->mail_out['body'][$body_part_num]['mime_headers'] = Array();
***************
*** 601,604 ****
--- 613,619 ----
                                
                                // Make Sure ALL INLINE BOUNDARY strings 
actually have CRLF CRLF preceeding them
+                               // because some lame MUA's don't properly 
format the message with CRLF CRLF BOUNDARY
+                               // in which case when we encapsulate such a 
malformed message, it *may* not be understood correctly 
+                               // by the receiving MUA, so we attempt to 
correct such a malformed message before we encapsulate it
                                // ---- not yet complete ----
                                $char_quot = '"';
***************
*** 642,645 ****
--- 657,662 ----
                                
//$this->mail_out['body'][$body_part_num]['mime_body'] = explode("\r\n", 
$fwd_this['processed']);
                                
$this->mail_out['body'][$body_part_num]['mime_body'] = 
$GLOBALS['phpgw']->msg->explode_linebreaks(trim($fwd_this['processed']));
+                               // clear this no longer needed var
+                               $fwd_this = '';
                                unset($fwd_this);
                        }

Index: class.mail_msg_base.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_base.inc.php,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -r1.61 -r1.62
*** class.mail_msg_base.inc.php 12 Jan 2002 10:02:27 -0000      1.61
--- class.mail_msg_base.inc.php 14 Jan 2002 20:51:37 -0000      1.62
***************
*** 80,91 ****
        
        // EXTRA ACCOUNTS
!       var $num_ex_accounts = 0;
        // holds the integer array key(s) of any defined extra account that has 
data, whether enabled or not
!       var $defined_ex_accounts = array();
        // same as above BUT only has "enabled" extra accounts integer array 
key(s)
!       var $enabled_ex_accounts = array();
        
        // DEBUG FLAGS generally take int 0, 1, 2, or 3
!       var $debug_logins =0;
        var $debug_session_caching = 0;
        var $debug_longterm_caching = 0;
--- 80,92 ----
        
        // EXTRA ACCOUNTS
!       var $ex_accounts_count = 0;
        // holds the integer array key(s) of any defined extra account that has 
data, whether enabled or not
!       //var $defined_ex_accounts = array();
        // same as above BUT only has "enabled" extra accounts integer array 
key(s)
!       //var $enabled_ex_accounts = array();
!       var $extra_acounts = array();
        
        // DEBUG FLAGS generally take int 0, 1, 2, or 3
!       var $debug_logins = 0;
        var $debug_session_caching = 0;
        var $debug_longterm_caching = 0;
***************
*** 101,137 ****
        // future (maybe never) usage
        //var $known_subtypes = array();
- 
- 
- 
        
-       // ----  the "old" way, straight up class vars
-       ////var $dcom;
-       ////var $args = Array();
-       // data from $GLOBALS['phpgw_info']['user']['preferences']['email'] 
goes here
-       ////var $prefs = Array();
-       // holds data retored from appsession (this var not needed)
-       // var $session_data = array();
-       // holding data in a class var for very temporary caching (L1 cache)
-       ////var $folder_status_info = array();
-       ////var $folder_list = array();
-       ////var $mailsvr_callstr = '';
-       ////var $mailsvr_namespace = '';
-       ////var $mailsvr_delimiter = '';
        
-       // mailsvr_stream and mailsvr_account_username are also used to 
determine if we are logged in already
-       // pointer (well, actually a data holder) to the primary mailbox stream 
(you may open others) returned by the first login 
-       ////var $mailsvr_stream = '';
-       // user name the we logged in as on the mailserver
-       ////var $mailsvr_account_username = '';
-       ////var $folder = '';
-       //var $newsmode = False;
-       //var $sort = '';
-       //var $order = '';
-       //var $start = '';
-       ////var $msgnum = '';
-       ////var $msgnum_idx = '-1';
-       
-       
- 
        /*
        function mail_msg_init()
--- 102,107 ----
***************
*** 327,330 ****
--- 297,302 ----
                        'to',
                        'cc',
+                       // bcc: we send the MTA the "RCPT TO" command for these 
BUT no bcc info is put in the message headers
+                       'bcc',
                        // body - POST var, never in URI (GET) that I know of, 
but it is possible, URI (EXTREMELY rare)
                        'body',
***************
*** 646,694 ****
                && (is_array($tmp_prefs['email']['ex_accounts'])))
                {
!                       $this->num_ex_accounts = 
count($tmp_prefs['email']['ex_accounts']);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $tmp_prefs[email][ex_accounts] is set and is_array, its count: 
$this->num_ex_accounts: ['.$this->num_ex_accounts.']<br>';}
!               }
!               else
!               {
!                       $this->num_ex_accounts = 0;
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $tmp_prefs[email][ex_accounts] NOT set or NOT is_array, 
$this->num_ex_accounts: ['.$this->num_ex_accounts.']<br>';}
!               }
!               
!               // ---- what accounts have some data defined
!               if ($this->num_ex_accounts > 0)
!               {
!                       while(list($key,$value) = 
each($tmp_prefs['email']['ex_accounts']))
                        {
                                if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: inside loop: for each $tmp_prefs[email][ex_accounts] ; $key: 
['.serialize($key).'] $value: ['.serialize($value).']<br>';}
                                // if we are here at all then this array item 
must have some data defined
!                               $next_pos = count($this->defined_ex_accounts);
!                               $this->defined_ex_accounts[$next_pos] = $key;
!                               // is this account "enabled"
!                               if ( 
(isset($tmp_prefs['email']['ex_accounts'][$key]['ex_account_enabled']))
                                && 
((string)$tmp_prefs['email']['ex_accounts'][$key]['ex_account_enabled'] != ''))
                                {
!                                       // this account is defined AND enabled, 
add it to $this->enabled_ex_accounts
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: inside loop: account enabled: 
$tmp_prefs[email][ex_accounts]['.$key.'][ex_account_enabled]:  
['.serialize($tmp_prefs['email']['ex_accounts'][$key]['ex_account_enabled']).']<br>';}
!                                       $next_pos = 
count($this->enabled_ex_accounts);
!                                       $this->enabled_ex_accounts[$next_pos] = 
$key;
                                }
                        }
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $this->defined_ex_accounts: 
['.serialize($this->defined_ex_accounts).'] ; $this->enabled_ex_accounts: 
['.serialize($this->enabled_ex_accounts).']<br>';}
!                       
!                       // PROCESS EXTRA ACCOUNT PREFS
!                       // run thru the create prefs function requesting this 
particular acctnum
!                       // fills in certain missing data, and does some sanity 
checks, and any data processing that may be necessary
!                       for ($i=0; $i <count($this->enabled_ex_accounts); $i++)
!                       {
!                               $tmp_prefs = array();
!                               // we "fool" create_email_preferences into 
processing extra account info as if it were top level data
!                               // by specifing the secong function arg as the 
integer of this particular enabled account
!                               $this_ex_acctnum = 
$this->enabled_ex_accounts[$i];
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: about to call create_email_preferences("", $this_ex_acctnum) 
where $this_ex_acctnum: ['.serialize($this_ex_acctnum).'] <br>'; }
!                               $tmp_prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences('', $this_ex_acctnum);
!                               // now put these processed prefs in the correct 
location  in our prefs array
!                               $this->set_pref_array($tmp_prefs['email'], 
$this_ex_acctnum);
!                       }
                }
                // clear the temp var
                $tmp_prefs = array();
--- 618,690 ----
                && (is_array($tmp_prefs['email']['ex_accounts'])))
                {
!                       $this->ex_accounts_count = 
count($tmp_prefs['email']['ex_accounts']);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $tmp_prefs[email][ex_accounts] is set and is_array, its count: 
$this->ex_accounts_count: ['.$this->ex_accounts_count.']<br>'; }
!                       if ($this->debug_logins > 2) { echo 
'$tmp_prefs[email][ex_accounts] DUMP<pre>'; 
print_r($tmp_prefs[email][ex_accounts]); echo '</pre>'; }
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: about to process extra account data ; $this->ex_accounts_count: 
['.$this->ex_accounts_count.']<br>'; }
!                       // note: extra accounts lowest possible value = 1, NOT 0
!                       // also, $key, although numbered integers, may not be 
conticuous lowest to highest (may be empty or missing elements inbetween)
!               
!                       // ---- what accounts have some data defined
!                       // array_extra_accounts[X]['acctnum'] : integer
!                       // array_extra_accounts[X]['status'] string = "enabled" 
| "disabled" | "empty"
!                       // NOTE: WHY does this cause this error *even* WHEN IT 
IS AN ARRAY?:
!                       //      Warning: Variable passed to each() is not an 
array or object in /phpgroupware/email/inc/class.mail_msg_base.inc.php on line 
661
!                       //while(list($key,$value) = 
each($tmp_prefs['email']['ex_accounts']))
!                       while(list($key,$value) = 
@each($tmp_prefs['email']['ex_accounts']))
                        {
                                if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: inside loop: for each $tmp_prefs[email][ex_accounts] ; $key: 
['.serialize($key).'] $value: ['.serialize($value).']<br>';}
                                // if we are here at all then this array item 
must have some data defined
!                               $next_pos = count($this->extra_accounts);
!                               $this->extra_accounts[$next_pos] = array();
!                               $this->extra_accounts[$next_pos]['acctnum'] = 
(int)$key;
!                               // ----  is this account "enabled", "disabled" 
or is this array item "empty"
!                               // first, see if it has essential data, if not, 
it's an empty array item
!                               if ( 
(!isset($tmp_prefs['email']['ex_accounts'][$key]['fullname']))
!                               || 
(!isset($tmp_prefs['email']['ex_accounts'][$key]['email_sig']))
!                               || 
(!isset($tmp_prefs['email']['ex_accounts'][$key]['layout'])) )
!                               {
!                                       // this account lacks essential data 
needed to describe an account, it must be an "empty" element
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: inside loop: account ['.$key.'] is *empty*: 
$tmp_prefs[email][ex_accounts]['.$key.']: 
['.serialize($tmp_prefs['email']['ex_accounts'][$key]).']<br>';}
!                                       
$this->extra_accounts[$next_pos]['status'] = 'empty';
!                               }
!                               // ... so the account is not empty ...
!                               elseif ( 
(isset($tmp_prefs['email']['ex_accounts'][$key]['ex_account_enabled']))
                                && 
((string)$tmp_prefs['email']['ex_accounts'][$key]['ex_account_enabled'] != ''))
                                {
!                                       // this account is defined AND enabled, 
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: inside loop: account ['.$key.'] is *enabled*: 
$tmp_prefs[email][ex_accounts]['.$key.'][ex_account_enabled]:  
['.serialize($tmp_prefs['email']['ex_accounts'][$key]['ex_account_enabled']).']<br>';}
!                                       
$this->extra_accounts[$next_pos]['status'] = 'enabled';
!                               }
!                               else
!                               {
!                                       // this account is defined BUT not 
enabled
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: inside loop: account ['.$key.'] is *disabled*: 
$tmp_prefs[email][ex_accounts]['.$key.'][ex_account_enabled]:  
['.serialize($tmp_prefs['email']['ex_accounts'][$key]['ex_account_enabled']).']<br>';}
!                                       
$this->extra_accounts[$next_pos]['status'] = 'disabled';
!                               }
!                               
!                               // IF ENABLED, then 
!                               if ($this->extra_accounts[$next_pos]['status'] 
== 'enabled')
!                               {
!                                       // PROCESS EXTRA ACCOUNT PREFS
!                                       // run thru the create prefs function 
requesting this particular acctnum
!                                       // fills in certain missing data, and 
does some sanity checks, and any data processing that may be necessary
!                                       $tmp_prefs = array();
!                                       // we "fool" create_email_preferences 
into processing extra account info as if it were top level data
!                                       // by specifing the secong function arg 
as the integer of this particular enabled account
!                                       $this_ex_acctnum = 
$this->extra_accounts[$next_pos]['acctnum'];
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: about to call create_email_preferences("", 
$this_ex_acctnum) where $this_ex_acctnum: ['.serialize($this_ex_acctnum).'] 
<br>'; }
!                                       $tmp_prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences('', $this_ex_acctnum);
!                                       // now put these processed prefs in the 
correct location  in our prefs array
!                                       
$this->set_pref_array($tmp_prefs['email'], $this_ex_acctnum);
                                }
                        }
!                       if ($this->debug_logins > 2) { echo 'mail_msg: 
begin_request: $this->extra_accounts dump:<pre>'; 
print_r($this->extra_accounts); echo '</pre>';}
                }
+               else
+               {
+                       $this->ex_accounts_count = 0;
+                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $tmp_prefs[email][ex_accounts] NOT set or NOT is_array, 
$this->ex_accounts_count: ['.$this->ex_accounts_count.']<br>';}
+               }
+               
                // clear the temp var
                $tmp_prefs = array();
***************
*** 761,766 ****
--- 757,765 ----
                // ----  Things Specific To Loging In, and Actually Logging In  
-----
                // $args_array['folder'] gets prep_folder_in and then is stored 
in class var $this->get_arg_value('folder')
+               
                if ($args_array['do_login'] == True)
                {
+                       
+                       
                        //  ----  Get Email Password
                        if ($this->get_isset_pref('passwd') == False)
***************
*** 913,916 ****
--- 912,939 ----
                        }
                        
+                       
+                       
+                       /*
+                       $fake_fldball = array();
+                       $fake_fldball['acctnum'] = $acctnum;
+                       $fake_fldball['folder'] = '';
+                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: about to issue: $this->open_stream_extra($fake_fldball, 
$args_array, $got_args): $this->open_stream_extra($fake_fldball, $args_array, 
$got_args);  $this->open_stream_extra('.serialize($fake_fldball).', 
'.serialize($args_array).', '.serialize($got_args).')'.'<br>';}
+                       $did_open_stream = 
$this->open_stream_extra($fake_fldball, $args_array, $got_args);
+                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $this->open_stream_extra returns: 
'.serialize($did_open_stream).'<br>';}
+                       // error check
+                       if ($did_open_stream == False)
+                       {
+                               if ($this->debug_logins > 0) { echo 'mail_msg: 
begin_request: LEAVING with did_open_stream ERROR, closing stream, FAILURE in 
$this->open_stream_extra <br>';}
+                               // log out since we could not reopen, something 
must have gone wrong
+                               $this->end_request(
+                                       array(
+                                               'acctnum' => $acctnum
+                                       )
+                               );
+                               return False;
+                       }
+                       */
+                       
+                       
                        // ----  Process "sort" "order" "start" and "msgnum" 
GPC args (if any) passed to the script  -----
                        // these args are so fundamental, they get stored in 
their own class vars
***************
*** 940,975 ****
        function end_request($args_array='')
        {
-               // args array currently not used
                if ($this->debug_logins > 0) { echo 'mail_msg: end_request: 
ENTERING'.'<br>';}
                //if ($this->debug_logins > 2) { echo 'mail_msg: end_request: 
direct access info dump of $this->a  :<pre>'; print_r($this->a) ; echo 
'</pre>';}
                
!               if (($this->get_isset_arg('mailsvr_stream') == True)
!               && ($this->get_arg_value('mailsvr_stream') != ''))
                {
!                       if ($this->debug_logins > 0) { echo 'mail_msg: 
end_request: stream exists, logging out'.'<br>'; }
!                       $this_acctnum = $this->acctnum;
!                       
$GLOBALS['phpgw_dcom_'.$this_acctnum]->dcom->close($this->get_arg_value('mailsvr_stream'));
!                       $this->set_arg_value('mailsvr_stream', '');
                }
                if ($this->debug_logins > 0) { echo 'mail_msg: end_request: 
LEAVING'.'<br>';}
-               //$this->a[$this->acctnum] = $tmp_a;
        }
  
  
  
!       function open_stream_extra($fldball='')
!       {
!               if ($this->debug_logins > 0) { echo 'mail_msg: 
open_stream_extra: ENTERING, fldball: ['.serialize($fldball).'] <br>'; }
!               $existing_mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
!               if ((isset($existing_mailsvr_stream))
!               && ((string)$existing_mailsvr_stream != ''))
                {
!                       if ($this->debug_logins > 0) { echo 'mail_msg: 
open_stream_extra: LEAVING, stream already exists, returning 
$existing_mailsvr_stream ['.serialize($existing_mailsvr_stream).'] <br>'; }
!                       return $existing_mailsvr_stream;
                }
                else
                {
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: stream for this account needs tp be opened'.'<br>'; }
!                       $acctnum = $fldball['acctnum'];
                        $mailsvr_callstr = 
$this->get_pref_value('mailsvr_callstr', $acctnum);
                        if ($this->get_isset_pref('passwd', $acctnum) == False)
--- 963,1024 ----
        function end_request($args_array='')
        {
                if ($this->debug_logins > 0) { echo 'mail_msg: end_request: 
ENTERING'.'<br>';}
                //if ($this->debug_logins > 2) { echo 'mail_msg: end_request: 
direct access info dump of $this->a  :<pre>'; print_r($this->a) ; echo 
'</pre>';}
+               if ((isset($args_array['acctnum']))
+               && ((string)$args_array['acctnum'] != ''))
+               {
+                       $acctnum = (int)$args_array['acctnum'];
+               }
+               else
+               {
+                       $acctnum = $this->get_acctnum();
+               }
                
!               if (($this->get_isset_arg('mailsvr_stream', $acctnum) == True)
!               && ($this->get_arg_value('mailsvr_stream', $acctnum) != ''))
                {
!                       if ($this->debug_logins > 0) { echo 'mail_msg: 
end_request: stream exists, for $acctnum ['.$acctnum.'] logging out'.'<br>'; }
!                       
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->close($this->get_arg_value('mailsvr_stream',
 $acctnum));
!                       $this->set_arg_value('mailsvr_stream', '', $acctnum);
                }
                if ($this->debug_logins > 0) { echo 'mail_msg: end_request: 
LEAVING'.'<br>';}
        }
  
  
  
!       function open_stream_extra($fldball='', $args_array='', $got_args='')
!       {               
!               if ($this->debug_logins > 0) { echo 'mail_msg: 
open_stream_extra: ENTERING, $fldball: ['.serialize($fldball).'] ; $args_array: 
['.serialize($args_array).'] ; $got_args: ['.serialize($got_args).']<br>'; }
!               
!               if ((isset($fldball['acctnum']))
!               && ((string)$fldball['acctnum'] != ''))
!               {
!                       $acctnum = (int)$fldball['acctnum'];
!               }
!               else
                {
!                       $acctnum = $this->get_acctnum();
!               }
!               if ((isset($fldball['folder']))
!               && ((string)$fldball['folder'] != ''))
!               {
!                       $input_folder_arg = $fldball['folder'];
!               }
!               else
!               {
!                       $input_folder_arg = '';
!               }
!               if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: $acctnum: ['.serialize($acctnum).'] ; $input_folder_arg: 
['.serialize($input_folder_arg).']<br>'; }           
!               
!               $mailsvr_stream = $this->get_arg_value('mailsvr_stream', 
$acctnum);
!               if ((isset($mailsvr_stream))
!               && ((string)$mailsvr_stream != ''))
!               {
!                       if ($this->debug_logins > 0) { echo 'mail_msg: 
open_stream_extra: PRE-EXISTING stream, do not re-login, $mailsvr_stream 
['.serialize($mailsvr_stream).'] <br>'; }
                }
                else
                {
!                       $mailsvr_stream = '';
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: stream for this account needs to be opened, login to 
$acctnum ['.$acctnum.']'.'<br>'; }
                        $mailsvr_callstr = 
$this->get_pref_value('mailsvr_callstr', $acctnum);
                        if ($this->get_isset_pref('passwd', $acctnum) == False)
***************
*** 1004,1008 ****
                        // ----  Create email server Data Communication Class  
----
                        $this_server_type = 
$this->get_pref_value('mail_server_type', $acctnum);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: creating new dcom_holder at 
$GLOBALS["phpgw_dcom_".$this_acctnum('.$this_acctnum.')] = new 
mail_dcom_holder'.'<br>'; }
                        $GLOBALS['phpgw_dcom_'.$acctnum] = new mail_dcom_holder;
                        $GLOBALS['phpgw_dcom_'.$acctnum]->dcom = 
CreateObject("email.mail_dcom", $this_server_type);
--- 1053,1057 ----
                        // ----  Create email server Data Communication Class  
----
                        $this_server_type = 
$this->get_pref_value('mail_server_type', $acctnum);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: creating new dcom_holder at 
$GLOBALS["phpgw_dcom_'.$acctnum.'] = new mail_dcom_holder'.'<br>'; }
                        $GLOBALS['phpgw_dcom_'.$acctnum] = new mail_dcom_holder;
                        $GLOBALS['phpgw_dcom_'.$acctnum]->dcom = 
CreateObject("email.mail_dcom", $this_server_type);
***************
*** 1018,1024 ****
                                
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->force_msg_uids = True;
                        }
!                       
                        set_time_limit(60);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: about to call dcom->open: 
$GLOBALS["phpgw_dcom_".$this_acctnum('.$this_acctnum.')]->dcom->open('.$mailsvr_callstr."INBOX".',
 '.$user.', '.$pass.', )'.'<br>'; }
                        $mailsvr_stream = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->open($mailsvr_callstr."INBOX", $user, 
$pass, '');
                        $pass = '';
--- 1067,1073 ----
                                
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->force_msg_uids = True;
                        }
!                       // log in to INBOX because we know INBOX should exist 
on every mail server, "reopen" to desired folder (if different) later
                        set_time_limit(60);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: about to call dcom->open: 
$GLOBALS["phpgw_dcom_'.$acctnum.']->dcom->open('.$mailsvr_callstr."INBOX".', 
'.$user.', '.$pass.', )'.'<br>'; }
                        $mailsvr_stream = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->open($mailsvr_callstr."INBOX", $user, 
$pass, '');
                        $pass = '';
***************
*** 1033,1077 ****
                                return False;
                        }
-                       
                        $this->set_arg_value('mailsvr_stream', $mailsvr_stream, 
$acctnum);
                        $this->set_arg_value('mailsvr_account_username', $user, 
$acctnum);
!                       
!                       $mailsvr_namespace = 
$this->get_arg_value('mailsvr_namespace', $acctnum);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: $mailsvr_namespace: '.serialize($mailsvr_namespace).'<br>'; }
!                       $mailsvr_delimiter = 
$this->get_arg_value('mailsvr_delimiter', $acctnum);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: $mailsvr_delimiter: '.serialize($mailsvr_delimiter).'<br>'; }
!                       
!                       $input_folder_arg = $fldball['folder'];
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: about to issue $processed_folder_arg = 
$this->prep_folder_in('.$input_folder_arg.')<br>'; }
                        $processed_folder_arg = 
$this->prep_folder_in($input_folder_arg);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: $processed_folder_arg value: 
['.$processed_folder_arg.']<br>'; }
!                       
!                       // ---- Switch To Desired Folder If Necessary  ----
!                       if ($processed_folder_arg == 'INBOX')
!                       {
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: NO need to switch folders, about to issue: 
$this->set_arg_value("folder", '.$processed_folder_arg.')<br>'; }
!                               $this->set_arg_value('folder', 
$processed_folder_arg, $acctnum);
                        }
                        else
                        {
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: need to switch folders (reopen) from INBOX to 
$processed_folder_arg: '.$processed_folder_arg.'<br>';}
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: about to issue: 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->reopen('.$mailsvr_stream.', 
'.$mailsvr_callstr.$processed_folder_arg,', )'.'<br>';}
!                               $did_reopen = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->reopen($mailsvr_stream, 
$mailsvr_callstr.$processed_folder_arg, '');
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: reopen returns: '.serialize($did_reopen).'<br>';}
!                               if ($did_reopen == False)
!                               {
!                                       if ($this->debug_logins > 0) { echo 
'mail_msg: open_stream_extra: LEAVING with re-open ERROR, closing stream, 
FAILED to reopen (change folders) $mailsvr_stream ['.$mailsvr_stream.'] INBOX 
to ['.$mailsvr_callstr.$processed_folder_arg.'<br>';}
!                                       $this->end_request($acctnum);
!                                       return False;
!                               }
!                               else
!                               {
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: open_stream_extra: Successful switch folders (reopen) from (default 
initial folder) INBOX to ['.$processed_folder_arg.']<br>';}
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: open_stream_extra: switched folders (via reopen), about to issue: 
$this->set_arg_value("folder", '.$processed_folder_arg.')<br>'; }
!                                       $this->set_arg_value('folder', 
$processed_folder_arg, $acctnum);
!                               }
                        }
-                       return $this->get_arg_value('mailsvr_stream', $acctnum);
                }
        }
  
--- 1082,1141 ----
                                return False;
                        }
                        $this->set_arg_value('mailsvr_stream', $mailsvr_stream, 
$acctnum);
                        $this->set_arg_value('mailsvr_account_username', $user, 
$acctnum);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: ... we just opened stream for $acctnum: 
['.serialize($acctnum).'] continue ...<br>'; }
!               }
!               if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: we have a stream for $acctnum: ['.serialize($acctnum).'] 
continue ...<br>'; }
!               
!               // ---- Switch To Desired Folder If Necessary  ----
!               // class will get this data on its own to do the lookup in 
prep_folder_in anyway, so might as well get it for us here at the same time
!               $mailsvr_namespace = $this->get_arg_value('mailsvr_namespace', 
$acctnum);
!               if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: $mailsvr_namespace: '.serialize($mailsvr_namespace).'<br>'; }
!               $mailsvr_delimiter = $this->get_arg_value('mailsvr_delimiter', 
$acctnum);
!               if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: $mailsvr_delimiter: '.serialize($mailsvr_delimiter).'<br>'; }
!               
!               // FIND FOLDER VALUE
!               // get best available, most legit, folder value that we can 
find, and prep it in
!               if ($input_folder_arg == '')
!               {
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: about to call: "get_best_folder_arg($args_array, $got_args, 
$acctnum(='.$acctnum.'))"<br>'; }
!                       $processed_folder_arg = 
$this->get_best_folder_arg($args_array, $got_args, $acctnum);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: "get_best_folder_arg" returns $processed_folder_arg 
['.htmlspecialchars(serialize($processed_folder_arg)).']<br>'; }
!               }
!               else
!               {
                        $processed_folder_arg = 
$this->prep_folder_in($input_folder_arg);
!               }
!               
!               
!               if ($processed_folder_arg == 'INBOX')
!               {
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: NO need to switch folders, about to issue: 
$this->set_arg_value("folder", '.$processed_folder_arg.')<br>'; }
!                       $this->set_arg_value('folder', $processed_folder_arg, 
$acctnum);
!               }
!               else
!               {
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: need to switch folders (reopen) from INBOX to 
$processed_folder_arg: '.$processed_folder_arg.'<br>';}
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: about to issue: 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->reopen('.$mailsvr_stream.', 
'.$mailsvr_callstr.$processed_folder_arg,', )'.'<br>';}
!                       $did_reopen = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->reopen($mailsvr_stream, 
$mailsvr_callstr.$processed_folder_arg, '');
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: reopen returns: '.serialize($did_reopen).'<br>';}
!                       if ($did_reopen == False)
!                       {
!                               if ($this->debug_logins > 0) { echo 'mail_msg: 
open_stream_extra: LEAVING with re-open ERROR, closing stream, FAILED to reopen 
(change folders) $mailsvr_stream ['.$mailsvr_stream.'] INBOX to 
['.$mailsvr_callstr.$processed_folder_arg.'<br>';}
!                               $this->end_request(
!                                       array(
!                                               'acctnum' => $acctnum
!                                       )
!                               );
!                               return False;
                        }
                        else
                        {
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: Successful switch folders (reopen) from (default initial 
folder) INBOX to ['.$processed_folder_arg.']<br>';}
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
open_stream_extra: switched folders (via reopen), about to issue: 
$this->set_arg_value("folder", '.$processed_folder_arg.')<br>'; }
!                               $this->set_arg_value('folder', 
$processed_folder_arg, $acctnum);
                        }
                }
+               return $this->get_arg_value('mailsvr_stream', $acctnum);
        }
  

Index: class.mail_msg_display.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_display.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** class.mail_msg_display.inc.php      12 Jan 2002 19:04:13 -0000      1.31
--- class.mail_msg_display.inc.php      14 Jan 2002 20:51:37 -0000      1.32
***************
*** 400,406 ****
        function all_ex_accounts_listbox($feed_args)
        {
!               // $this->num_ex_accounts
!               // $this->defined_ex_accounts
!               // $this->enabled_ex_accounts
                
                if(!$feed_args)
--- 400,405 ----
        function all_ex_accounts_listbox($feed_args)
        {
!               // $this->ex_accounts_count
!               // $this->extra_accounts
                
                if(!$feed_args)
***************
*** 452,455 ****
--- 451,455 ----
                $item_tags = '';
                
+               // ----  add the default email account, account number 0  ----
                // this logic determines if the combobox should be initialized 
with certain account already selected
                if ((string)$local_args['pre_select_acctnum'] == '0')
***************
*** 461,466 ****
                        $sel = '';
                }
-               
-               // add the default email account, account number 0
                // this fake_uri data will be converted to fldball data on 
submit processing
                $option_value =  '&'.$local_args['folder_key_name'].'=INBOX'
--- 461,464 ----
***************
*** 473,498 ****
                
                // iterate thru the ex_accounts list, building the HTML tags 
using that data
!               for ($i=0; $i < count($this->defined_ex_accounts); $i++)
                {
!                       // the option values below are in the form of embedded 
fake_uri
!                       $this_acctnum = $this->defined_ex_accounts[$i];
!                       // is this account "enabled" ?
!                       // array_search_ex($needle='', $haystack='', 
$strict=False)
!                       $enabled = $this->array_search_ex($this_acctnum, 
$this->enabled_ex_accounts);
!                       // note: is_bool is in the php3 compat library
!                       // note: array position 0 != boolean false, thus the 
test below
!                       if ((is_bool($enabled))
!                       && ($enabled == False))
                        {
                                // FUTURE: take user to the extra accounts 
management page for this particular account
                                // now: put the user back to the default account
                                $option_value =  
'&'.$local_args['folder_key_name'].'=INBOX'
                                                
.'&'.$local_args['acctnum_key_name'].'=0';
!                               $option_text = lang('account').' 
['.$this_acctnum.'] disabled';
                                
                                // note: a disabled account can not be 
pre-selected
                                $item_tags .= '<option 
value="'.$option_value.'">'.$option_text.'</option>'."\r\n";
                        }
!                       else
                        {
                                // this logic determines if the combobox should 
be initialized with certain account already selected
--- 471,491 ----
                
                // iterate thru the ex_accounts list, building the HTML tags 
using that data
!               for ($i=0; $i < count($this->extra_accounts); $i++)
                {
!                       $this_acctnum = $this->extra_accounts[$i]['acctnum'];
!                       // is this account "enabled", "disabled", or "empty"
!                       if ($this->extra_accounts[$i]['status'] == 'disabled')
                        {
+                               // the option values below are in the form of 
embedded fake_uri
                                // FUTURE: take user to the extra accounts 
management page for this particular account
                                // now: put the user back to the default account
                                $option_value =  
'&'.$local_args['folder_key_name'].'=INBOX'
                                                
.'&'.$local_args['acctnum_key_name'].'=0';
!                               $option_text = lang('account').' 
['.$this_acctnum.'] '.lang('disabled');
                                
                                // note: a disabled account can not be 
pre-selected
                                $item_tags .= '<option 
value="'.$option_value.'">'.$option_text.'</option>'."\r\n";
                        }
!                       elseif ($this->extra_accounts[$i]['status'] == 
'enabled')
                        {
                                // this logic determines if the combobox should 
be initialized with certain account already selected
***************
*** 518,521 ****
--- 511,515 ----
                                $item_tags .= '<option 
value="'.$option_value.'"'.$sel.'>'.$option_text.'</option>'."\r\n";
                        }
+                       // if not enabled or disabed, it must be empty, in 
which case we ignore it
                }
                // now $item_tags contains the internal folder list
***************
*** 764,768 ****
                                                                                
        if ($deepest_level < 5) { $deepest_level=5; }
                                                                                
        
!                                                                               
        // get SISTH LEVEL EMBEDDED level part information
                                                                                
        $d5_array_pos = $array_position;
                                                                                
        if ($d5_part['ex_num_subparts'] != $not_set)
--- 758,762 ----
                                                                                
        if ($deepest_level < 5) { $deepest_level=5; }
                                                                                
        
!                                                                               
        // get SIXTH LEVEL EMBEDDED level part information
                                                                                
        $d5_array_pos = $array_position;
                                                                                
        if ($d5_part['ex_num_subparts'] != $not_set)
***************
*** 890,893 ****
--- 884,889 ----
                        // however, a base64 part IS an attachment even if it 
has no name, just make one up
                        // also, if "disposition" header = "attachment", same 
thing, it's an attachment, and if no name is in the params, make one up
+                       // note: we do not use "elseif" during this because an 
attachment may be detected in *any* of the following code blocks
+                       // in no particular, nor predictable, order
                        
                        // Fallback / Default: assume No Attachment here
***************
*** 896,900 ****
                        $part_nice[$i]['ex_attachment'] = False;
                        
!                       // Attachment Detection PART1 = if a part has a 
NAME=FOO in the param pairs, then treat as an attachment
                        if (($part_nice[$i]['ex_num_param_pairs'] > 0)
                        && ($part_nice[$i]['ex_attachment'] == False))
--- 892,896 ----
                        $part_nice[$i]['ex_attachment'] = False;
                        
!                       // Attachment Detection PART1-A = if a part has a 
NAME=FOO in the param pairs, then treat as an attachment
                        if (($part_nice[$i]['ex_num_param_pairs'] > 0)
                        && ($part_nice[$i]['ex_attachment'] == False))
***************
*** 911,914 ****
--- 907,926 ----
                                }
                        }
+                       // Attachment Detection PART1-B = if a part has a 
NAME=FOO in the dparam pairs, then treat as an attachment
+                       if (($part_nice[$i]['ex_num_dparam_pairs'] > 0)
+                       && ($part_nice[$i]['ex_attachment'] == False))
+                       {
+                               for ($p = 0; $p < 
$part_nice[$i]['ex_num_dparam_pairs']; $p++)
+                               {
+                                       if 
(($part_nice[$i]['dparams'][$p]['attribute'] == 'name') 
+                                         && 
($part_nice[$i]['dparams'][$p]['value'] != $not_set))
+                                       {
+                                               $part_nice[$i]['ex_part_name'] 
= $part_nice[$i]['dparams'][$p]['value'];
+                                               $part_nice[$i]['ex_attachment'] 
= True;
+                                               break;
+                                       }
+                               }
+                       }
+                       
                        // Attachment Detection PART2 = if a part has 
encoding=base64 , then treat as an attachment
                        //      eventhough the above code did not find a name 
for the part
***************
*** 949,953 ****
                                        // Digression: why we can't do any more 
then this
                                        // we have no idea of it's name, and 
*maybe* no idea of it's content type
!                                       // (eg. name.gif = image/gif  which is 
"OBVIOUS" even if the mail headers fon't tell us that)
                                        // sometimes the name's extention is 
the only info we have, i.e. ".doc" implies a WORD file
                                        // but we can not do much here because 
we have NO name
--- 961,965 ----
                                        // Digression: why we can't do any more 
then this
                                        // we have no idea of it's name, and 
*maybe* no idea of it's content type
!                                       // (eg. name.gif = image/gif  which is 
"OBVIOUS" even if the mail headers don't tell us that)
                                        // sometimes the name's extention is 
the only info we have, i.e. ".doc" implies a WORD file
                                        // but we can not do much here because 
we have NO name
***************
*** 1089,1095 ****
                        // TEMPORARY HACK FOR SOCKET POP3 CLASS - feed it DUMB 
mime part numbers
                        
-                       //$tmp_a = $this->a[$this->acctnum];
-                       //if ((isset($tmp_a['dcom']->imap_builtin))
-                       //&& ($tmp_a['dcom']->imap_builtin == False)
                        if 
((isset($GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->imap_builtin))
                        && 
($GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->imap_builtin == False)
--- 1101,1104 ----
***************
*** 1104,1108 ****
                                $part_nice[$i]['m_part_num_mime'] = 
$part_nice[$i]['ex_mime_number_smart'];
                        }
-                       //$this->a[$this->acctnum] = $tmp_a;
                        
                        // ------  MAKE CLICKABLE HREF TO THIS PART  -------
--- 1113,1116 ----
***************
*** 1157,1160 ****
--- 1165,1174 ----
                        $part_nice['type'] = $part_type;
                }
+               // RFC SAYS TYPE "TEXT" IS *DEFAULT* AND MAY BE *ASSUMED* IN 
THE ABSENCE OF IT BEING SPECIFIED
+               if (($part_nice['type'] == 'unknown')
+               || ($part_nice['type'] == $not_set))
+               {
+                       $part_nice['type'] = 'text';
+               }
                
                // 2: ENCODING
***************
*** 1225,1229 ****
                }
                //13:  ifdparameters : True if the dparameters array exists 
SKIPPED -  ifparameters is more useful (I think)
!               //14:  dparameters : Disposition parameter array SKIPPED -  
parameters is more useful (I think)
                // 15:  ifparameters : True if the parameters array exists 
(SKIP)
                // 16:  parameters : MIME parameters array  - this *may* have 
more than a single attribute / value pair  but I'm not sure
--- 1239,1270 ----
                }
                //13:  ifdparameters : True if the dparameters array exists 
SKIPPED -  ifparameters is more useful (I think)
!               //14:  dparameters : Disposition parameter array
!               // *not* SKIPPED, although parameters is more useful (I think), 
dparameters may sometimes hold an attachment name
!               // ex_num_dparam_pairs defaults to 0 (no dparams)
!               $part_nice['ex_num_dparam_pairs'] = 0;
!               if ( (isset($part->ifdparameters)) && ($part->ifdparameters)
!               && (isset($part->dparameters)) && ($part->dparameters) )
!               {
!                       // Custom/Extra Information (ex_):  ex_num_dparam_pairs
!                       $part_nice['ex_num_dparam_pairs'] = 
count($part->dparameters);
!                       // capture data from all dparam attribute=value pairs
!                       for ($pairs = 0; $pairs < 
$part_nice['ex_num_dparam_pairs']; $pairs++)
!                       {
!                               $part_dparams = $part->dparameters[$pairs];
!                               $part_nice['dparams'][$pairs]['attribute'] = 
$not_set; // default / fallback
!                               if ((isset($part_dparams->attribute) && 
($part_dparams->attribute)))
!                               {
!                                       
$part_nice['dparams'][$pairs]['attribute'] = $part_dparams->attribute;
!                                       
$part_nice['dparams'][$pairs]['attribute'] = 
trim(strtolower($part_nice['dparams'][$pairs]['attribute']));
!                               }
!                               $part_nice['dparams'][$pairs]['value'] = 
$not_set; // default / fallback
!                               if ((isset($part_dparams->value) && 
($part_dparams->value)))
!                               {
!                                       $part_nice['dparams'][$pairs]['value'] 
= $part_dparams->value;
!                                       // stuff like file names should retain 
their case
!                                       
//$part_nice['dparams'][$pairs]['value'] = 
strtolower($part_nice['dparams'][$pairs]['value']);
!                               }
!                       }
!               }
                // 15:  ifparameters : True if the parameters array exists 
(SKIP)
                // 16:  parameters : MIME parameters array  - this *may* have 
more than a single attribute / value pair  but I'm not sure

Index: class.mail_msg_wrappers.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_wrappers.inc.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** class.mail_msg_wrappers.inc.php     12 Jan 2002 10:02:27 -0000      1.23
--- class.mail_msg_wrappers.inc.php     14 Jan 2002 20:51:37 -0000      1.24
***************
*** 164,169 ****
                        }
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->get_body($mailsvr_stream, 
$msgball['msgnum']);
!                       return $retval;
                }
                
--- 164,168 ----
                        }
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->get_body($mailsvr_stream, 
$msgball['msgnum']);
                }
                

Index: class.uicompose.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.uicompose.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.uicompose.inc.php     8 Jan 2002 15:06:03 -0000       1.1
--- class.uicompose.inc.php     14 Jan 2002 20:51:38 -0000      1.2
***************
*** 86,89 ****
--- 86,90 ----
                                'to_box_value'          => 
$this->bo->xi['to_box_value'],
                                'cc_box_value'          => 
$this->bo->xi['cc_box_value'],
+                               'bcc_box_value'         => 
$this->bo->xi['bcc_box_value'],
                                'subj_box_value'        => 
$this->bo->xi['subject'],
                                'body_box_value'        => 
$this->bo->xi['body'],
***************
*** 105,108 ****
--- 106,111 ----
                                'cc_box_desc'           => 
$this->bo->xi['cc_box_desc'],
                                'cc_box_name'           => 
$this->bo->xi['cc_box_name'],
+                               'bcc_box_desc'          => 
$this->bo->xi['bcc_box_desc'],
+                               'bcc_box_name'          => 
$this->bo->xi['bcc_box_name'],
                                'subj_box_desc'         => 
$this->bo->xi['subj_box_desc'],
                                'subj_box_name'         => 
$this->bo->xi['subj_box_name'],

Index: class.uimessage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.uimessage.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.uimessage.inc.php     3 Jan 2002 22:40:16 -0000       1.2
--- class.uimessage.inc.php     14 Jan 2002 20:51:38 -0000      1.3
***************
*** 102,105 ****
--- 102,146 ----
                        }
                        
+                       //  ----  TOOL BAR / MENU BAR ----
+                       
$GLOBALS['phpgw']->template->set_var('accounts_label',$this->bo->xi['accounts_label']);
+                       
$GLOBALS['phpgw']->template->set_var('ctrl_bar_font',$this->bo->xi['ctrl_bar_font']);
+                       
$GLOBALS['phpgw']->template->set_var('ctrl_bar_font_size',$this->bo->xi['ctrl_bar_font_size']);
+                       
$GLOBALS['phpgw']->template->set_var('ctrl_bar_back1',$this->bo->xi['ctrl_bar_back1']);
+                       
$GLOBALS['phpgw']->template->set_var('current_sort',$this->bo->xi['current_sort']);
+                       
$GLOBALS['phpgw']->template->set_var('current_order',$this->bo->xi['current_order']);
+                       
$GLOBALS['phpgw']->template->set_var('current_start',$this->bo->xi['current_start']);
+                       // ---- account switchbox  ----
+                       
$GLOBALS['phpgw']->template->set_var('acctbox_listbox',$this->bo->xi['acctbox_listbox']);
+                       
$GLOBALS['phpgw']->template->set_var('acctbox_frm_name',$this->bo->xi['acctbox_frm_name']);
+                       
$GLOBALS['phpgw']->template->set_var('acctbox_action',$this->bo->xi['acctbox_action']);
+                       // ---- Move Message Box  ----
+                       
$GLOBALS['phpgw']->template->set_var('mlist_checkbox_name',$this->bo->xi['mlist_checkbox_name']);
+                       
$GLOBALS['phpgw']->template->set_var('mlist_embedded_uri',$this->bo->xi['mlist_embedded_uri']);
+                       
$GLOBALS['phpgw']->template->set_var('frm_delmov_action',$this->bo->xi['frm_delmov_action']);
+                       
$GLOBALS['phpgw']->template->set_var('frm_delmov_name',$this->bo->xi['frm_delmov_name']);
+                       
$GLOBALS['phpgw']->template->set_var('delmov_listbox',$this->bo->xi['delmov_listbox']);
+                       
+               
+               /*
+               ok      acctbox_frm_name
+               ok      acctbox_action
+               ok      ctrl_bar_back1
+               ok      acctbox_listbox
+               ok      ctrl_bar_font
+               ok      ctrl_bar_font_size
+               ok      accounts_label
+                       
+               ok      frm_delmov_name
+               ok      frm_delmov_action
+               ok      current_sort
+               ok      current_order
+               ok      current_start
+               ok      mlist_checkbox_name
+               ok      mlist_embedded_uri
+               ok      delmov_listbox
+               */      
+                       
+                       
+                       
                        
$GLOBALS['phpgw']->template->set_var('ilnk_prev_msg',$this->bo->xi['ilnk_prev_msg']);
                        
$GLOBALS['phpgw']->template->set_var('ilnk_next_msg',$this->bo->xi['ilnk_next_msg']);
***************
*** 185,188 ****
--- 226,230 ----
                        
$GLOBALS['phpgw']->template->set_var('view_option',$this->bo->xi['view_option']);
                        
$GLOBALS['phpgw']->template->set_var('view_headers_href',$this->bo->xi['view_headers_href']);
+                       
$GLOBALS['phpgw']->template->set_var('view_raw_message_href',$this->bo->xi['view_raw_message_href']);
                        
                        // -----  SHOW MESSAGE  -------

Index: class.uipreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.uipreferences.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.uipreferences.inc.php 12 Jan 2002 19:04:13 -0000      1.9
--- class.uipreferences.inc.php 14 Jan 2002 20:51:38 -0000      1.10
***************
*** 422,426 ****
                        // ---  Extra Account Pref Items  ---
                        // section title
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
'*** '.lang('Extra E-Mail Account').' *** '.lang('Number.' 
'.$this->bo->acctnum));
                        // parse the block,
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');
--- 422,426 ----
                        // ---  Extra Account Pref Items  ---
                        // section title
!                       $GLOBALS['phpgw']->template->set_var('section_title', 
'*** '.lang('Extra E-Mail Account').' *** '.lang('Number').' 
'.$this->bo->acctnum);
                        // parse the block,
                        
$GLOBALS['phpgw']->template->parse('V_tr_sec_title','B_tr_sec_title');

Index: hook_home.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/hook_home.inc.php,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -r1.48 -r1.49
*** hook_home.inc.php   3 Jan 2002 22:40:16 -0000       1.48
--- hook_home.inc.php   14 Jan 2002 20:51:38 -0000      1.49
***************
*** 91,99 ****
                                );
                        }
                        // ADD FOLDER LISTBOX TO HOME PAGE (Needs to be 
TEMPLATED)
                        // Does This Mailbox Support Folders (i.e. more than 
just INBOX)?
                        if 
($GLOBALS['phpgw']->msg->get_mailsvr_supports_folders() == False)
                        {
!                               $extra_data = '';
                        }
                        else
--- 91,111 ----
                                );
                        }
+                       
+                       // COMPOSE NEW email link
+                       $compose_link = $GLOBALS['phpgw']->link(
+                                                               '/index.php',
+                                                                
'menuaction=email.uicompose.compose'
+                                                               // this data 
tells us where to return to after sending a message
+                                                               // since we 
started from home page, send can not (at this time) take us back there
+                                                               // so instead 
take user to INBOX for the default account (acctnum 0) after clicking the send 
button
+                                                               
.'&fldball[folder]=INBOX'
+                                                               
.'&fldball[acctnum]=0');
+                       $compose_href = '<a 
href="'.$compose_link.'">'.lang('Compose New').'</a>'."\r\n";
+                       
                        // ADD FOLDER LISTBOX TO HOME PAGE (Needs to be 
TEMPLATED)
                        // Does This Mailbox Support Folders (i.e. more than 
just INBOX)?
                        if 
($GLOBALS['phpgw']->msg->get_mailsvr_supports_folders() == False)
                        {
!                               $extra_data = '&nbsp; &nbsp;'.$compose_href;
                        }
                        else
***************
*** 118,122 ****
                                $switchbox_listbox = 
$GLOBALS['phpgw']->msg->all_folders_listbox($feed_args);
                                // make it another TR we can insert into the 
home page portal object
!                               // and surround it in FORM tage so the submit 
will work
                                $switchbox_action = $GLOBALS['phpgw']->link(
                                                                '/index.php',
--- 130,134 ----
                                $switchbox_listbox = 
$GLOBALS['phpgw']->msg->all_folders_listbox($feed_args);
                                // make it another TR we can insert into the 
home page portal object
!                               // and surround it in FORM tags so the submit 
will work
                                $switchbox_action = $GLOBALS['phpgw']->link(
                                                                '/index.php',
***************
*** 125,129 ****
                                        '<form name="switchbox" 
action="'.$switchbox_action.'" method="post">'."\r\n"
                                                .'<td align="left">'."\r\n"
!                                                       .'&nbsp;<strong>E-Mail 
Folders:</strong>&nbsp;'.$switchbox_listbox
                                                .'</td>'."\r\n"
                                        .'</form>'."\r\n";
--- 137,142 ----
                                        '<form name="switchbox" 
action="'.$switchbox_action.'" method="post">'."\r\n"
                                                .'<td align="left">'."\r\n"
!                                                       .'&nbsp;<strong>E-Mail 
Folders:</strong>&nbsp;'.$switchbox_listbox."\r\n"
!                                                       .'&nbsp; 
&nbsp;'.$compose_href."\r\n"
                                                .'</td>'."\r\n"
                                        .'</form>'."\r\n";
***************
*** 163,167 ****
                }
  
!               // output the portalbox and (if applicable) the folders listbox 
below it
                echo "\r\n".'<!-- start Mailbox info -->'."\r\n"
                        .$portalbox->draw($extra_data)
--- 176,180 ----
                }
  
!               // output the portalbox and below it (1) the folders listbox 
(if applicable) and (2) Compose New mail link
                echo "\r\n".'<!-- start Mailbox info -->'."\r\n"
                        .$portalbox->draw($extra_data)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]