phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: email/inc class.mail_dcom_pop3_sock.inc.php,1.17


From: Dan Kuykendall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: email/inc class.mail_dcom_pop3_sock.inc.php,1.17,1.17.2.1
Date: Fri, 15 Feb 2002 19:15:16 -0500

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

Modified Files:
      Tag: Version-0_9_14-branch
        class.mail_dcom_pop3_sock.inc.php 
Log Message:
fixed for php3

Index: class.mail_dcom_pop3_sock.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.mail_dcom_pop3_sock.inc.php,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C2 -r1.17 -r1.17.2.1
*** class.mail_dcom_pop3_sock.inc.php   14 Dec 2001 21:45:37 -0000      1.17
--- class.mail_dcom_pop3_sock.inc.php   16 Feb 2002 00:15:13 -0000      1.17.2.1
***************
*** 504,538 ****
                                        
                                        // go deeper
!                                       if 
(isset($this->msg_structure->parts[$lev_1]->parts))
                                        {
!                                               for ($lev_2=0; $lev_2 < 
count($this->msg_structure->parts[$lev_1]->parts) ;$lev_2++)
                                                {
                                                        // grap 2nd level 
embedded data (if any)
!                                                       if ($this->debug_dcom 
>= 2) { echo '<br>***<br>* * * * * * * * *<br>pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.'] of 
['.(string)(count($this->msg_structure->parts[$lev_1]->parts)-1).'] embedded 
parts discovery * * * * *<br>'; }
                                                        // Create Sub-Parts 
FetchStructure Data  (if necessary)  ---
                                                        // NOTE: param to  
create_embeded_fetchstructure  is a REFERENCE
!                                                       
$this->create_embeded_fetchstructure(&$this->msg_structure->parts[$lev_1]->parts[$lev_2]);
                                                        
                                                        // go deeper
!                                                       if 
(isset($this->msg_structure->parts[$lev_1]->parts[$lev_2]->parts))
                                                        {
!                                                               for ($lev_3=0; 
$lev_3 < count($this->msg_structure->parts[$lev_1]->parts[$lev_2]->parts) 
;$lev_3++)
                                                                {
                                                                        // grap 
3rd level embedded data (if any)
!                                                                       if 
($this->debug_dcom >= 2) { echo '<br>***<br>* * * * * * * * *<br>pop3: 
fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.']->parts['.$lev_3.'] of 
['.(string)(count($this->msg_structure->parts[$lev_1]->parts[$lev_2]->parts)-1).']
 embedded parts discovery * * * * *<br>'; }
                                                                        // 
Create 3rd Level Sub-Parts FetchStructure Data  (if necessary)  ---
                                                                        // 
NOTE: param to  create_embeded_fetchstructure  is a REFERENCE
!                                                                       
$this->create_embeded_fetchstructure(&$this->msg_structure->parts[$lev_1]->parts[$lev_2]->parts[$lev_3]);
                                                                        
                                                                        // go 
deeper
!                                                                       if 
(isset($this->msg_structure->parts[$lev_1]->parts[$lev_2]->parts[$lev_3]->parts))
                                                                        {
!                                                                               
for ($lev_4=0; $lev_4 < 
count($this->msg_structure->parts[$lev_1]->parts[$lev_2]->parts[$lev_3]->parts) 
;$lev_4++)
                                                                                
{
                                                                                
        // grap 3rd level embedded data (if any)
!                                                                               
        if ($this->debug_dcom >= 2) { echo '<br>***<br>* * * * * * * * 
*<br>pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.']->parts['.$lev_3.']->parts['.$lev_4.']
 of 
['.(string)(count($this->msg_structure->parts[$lev_1]->parts[$lev_2]->parts[$lev_3]->parts)-1).']
 embedded parts discovery * * * * *<br>'; }
                                                                                
        // Create Sub-Parts FetchStructure Data  (if necessary)  ---
                                                                                
        // NOTE: param to  create_embeded_fetchstructure  is a REFERENCE
!                                                                               
        
$this->create_embeded_fetchstructure(&$this->msg_structure->parts[$lev_1]->parts[$lev_2]->parts[$lev_3]->parts[$lev_4]);
                                                                                
}
                                                                        }
--- 504,541 ----
                                        
                                        // go deeper
!                                       $tmp_lev_1 = 
$this->msg_structure->parts[$lev_1];
!                                       if (isset($tmp_lev_1->parts))
                                        {
!                                               for ($lev_2=0; $lev_2 < 
count($tmp_lev_1->parts) ;$lev_2++)
                                                {
                                                        // grap 2nd level 
embedded data (if any)
!                                                       if ($this->debug_dcom 
>= 2) { echo '<br>***<br>* * * * * * * * *<br>pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.'] of 
['.(string)(count($tmp_lev_1->parts)-1).'] embedded parts discovery * * * * 
*<br>'; }
                                                        // Create Sub-Parts 
FetchStructure Data  (if necessary)  ---
                                                        // NOTE: param to  
create_embeded_fetchstructure  is a REFERENCE
!                                                       
$this->create_embeded_fetchstructure(&$tmp_lev_1->parts[$lev_2]);
                                                        
                                                        // go deeper
!                                                       $tmp_lev_2 = 
$tmp_lev_1->parts[$lev_2];
!                                                       if 
(isset($tmp_lev_2->parts))
                                                        {
!                                                               for ($lev_3=0; 
$lev_3 < count($tmp_lev_2->parts) ;$lev_3++)
                                                                {
                                                                        // grap 
3rd level embedded data (if any)
!                                                                       if 
($this->debug_dcom >= 2) { echo '<br>***<br>* * * * * * * * *<br>pop3: 
fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.']->parts['.$lev_3.'] of 
['.(string)(count($tmp_lev_2->parts)-1).'] embedded parts discovery * * * * 
*<br>'; }
                                                                        // 
Create 3rd Level Sub-Parts FetchStructure Data  (if necessary)  ---
                                                                        // 
NOTE: param to  create_embeded_fetchstructure  is a REFERENCE
!                                                                       
$this->create_embeded_fetchstructure(&$tmp_lev_2->parts[$lev_3]);
                                                                        
                                                                        // go 
deeper
!                                                                       
$tmp_lev_3 = $tmp_lev_2->parts[$lev_3];
!                                                                       if 
(isset($tmp_lev_3->parts))
                                                                        {
!                                                                               
for ($lev_4=0; $lev_4 < count($tmp_lev_3->parts) ;$lev_4++)
                                                                                
{
                                                                                
        // grap 3rd level embedded data (if any)
!                                                                               
        if ($this->debug_dcom >= 2) { echo '<br>***<br>* * * * * * * * 
*<br>pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.']->parts['.$lev_3.']->parts['.$lev_4.']
 of ['.(string)(count($tmp_lev_3->parts)-1).'] embedded parts discovery * * * * 
*<br>'; }
                                                                                
        // Create Sub-Parts FetchStructure Data  (if necessary)  ---
                                                                                
        // NOTE: param to  create_embeded_fetchstructure  is a REFERENCE
!                                                                               
        $this->create_embeded_fetchstructure(&$tmp_lev_3->parts[$lev_4]);
                                                                                
}
                                                                        }
***************
*** 746,766 ****
                                                // if we were in the state of 
"IN" on that prevoius part (if any previous part exists)
                                                $cur_part_idx = 
count($info->parts) - 1;
!                                               if 
((isset($info->parts[$cur_part_idx]))
!                                               && 
($info->parts[$cur_part_idx]->custom['detect_state'] == 'in'))
                                                {
                                                        // we were already "in" 
so we found ENDING data
                                                        // for the previous 
part, (as well as BEGINING data for the next part)
                                                        // --Bytes-- we have a 
running total of byte size, but in testing against UWash, I was over by 2 
bytes, so fix that
!                                                       
$info->parts[$cur_part_idx]->bytes = $info->parts[$cur_part_idx]->bytes - 2;
!                                                       
$info->parts[$cur_part_idx]->custom['part_end'] = $x-1;
                                                        // --Lines-- we know 
beginning line and ending line, so calculate # lines for this part
!                                                       
$info->parts[$cur_part_idx]->lines = 
(int)$info->parts[$cur_part_idx]->custom['part_end'] - 
(int)$info->parts[$cur_part_idx]->custom['part_start'];
!                                                       if ($this->debug_dcom 
>= 2) { echo 'pop3: create_embeded_fetchstructure: mime loop: current part end 
at ['.(string)($x-1).'] byte cumula: ['.$info->parts[$cur_part_idx]->bytes.'] 
lines: ['.$info->parts[$cur_part_idx]->lines.']<br>'; }
                                                        // this individual part 
has completed discovery, it os now "OUT"
!                                                       
$info->parts[$cur_part_idx]->custom['detect_state'] = 'out';
                                                        // we are DONE with 
this part for now 
                                                        // unset any unfilled 
elements
                                                        // NOTE: param to  
unset_unfilled_fetchstructure  is a REFERENCE
!                                                       
$this->unset_unfilled_fetchstructure(&$info->parts[$cur_part_idx]);
                                                }
                                                // so now deal with this NEW 
part we just discovered
--- 749,777 ----
                                                // if we were in the state of 
"IN" on that prevoius part (if any previous part exists)
                                                $cur_part_idx = 
count($info->parts) - 1;
!                                               
!                                               if 
(isset($info->parts[$cur_part_idx]))
!                                               {
!                                                       $tmp_cur_part_idx = 
$info->parts[$cur_part_idx];
!                                               }
! 
!                                               if ((isset($tmp_cur_part_idx))
!                                               && 
($tmp_cur_part_idx->custom['detect_state'] == 'in'))
                                                {
                                                        // we were already "in" 
so we found ENDING data
                                                        // for the previous 
part, (as well as BEGINING data for the next part)
                                                        // --Bytes-- we have a 
running total of byte size, but in testing against UWash, I was over by 2 
bytes, so fix that
!                                                       
$tmp_cur_part_idx->bytes = $tmp_cur_part_idx->bytes - 2;
!                                                       
$tmp_cur_part_idx->custom['part_end'] = $x-1;
                                                        // --Lines-- we know 
beginning line and ending line, so calculate # lines for this part
!                                                       
$tmp_cur_part_idx->lines = (int)$tmp_cur_part_idx->custom['part_end'] - 
(int)$tmp_cur_part_idx->custom['part_start'];
!                                                       if ($this->debug_dcom 
>= 2) { echo 'pop3: create_embeded_fetchstructure: mime loop: current part end 
at ['.(string)($x-1).'] byte cumula: ['.$tmp_cur_part_idx->bytes.'] lines: 
['.$tmp_cur_part_idx->lines.']<br>'; }
                                                        // this individual part 
has completed discovery, it os now "OUT"
!                                                       
$tmp_cur_part_idx->custom['detect_state'] = 'out';
                                                        // we are DONE with 
this part for now 
                                                        // unset any unfilled 
elements
                                                        // NOTE: param to  
unset_unfilled_fetchstructure  is a REFERENCE
!                                                       
$this->unset_unfilled_fetchstructure(&$tmp_cur_part_idx);
!                                                       
$info->parts[$cur_part_idx] = $tmp_cur_part_idx;
!                                                       
unset($tmp_cur_part_idx);
                                                }
                                                // so now deal with this NEW 
part we just discovered
***************
*** 769,781 ****
                                                $new_part_idx = 
count($info->parts);
                                                $info->parts[$new_part_idx] = 
new msg_structure;
!                                               
$info->parts[$new_part_idx]->bytes = 0;
!                                               
$info->parts[$new_part_idx]->custom['top_level'] = False;
!                                               
$info->parts[$new_part_idx]->custom['parent_cookie'] = 
$info->custom['my_cookie'];
                                                // state info: we are now "IN" 
doing multi part detection on this part
!                                               
$info->parts[$new_part_idx]->custom['detect_state'] = 'in';
                                                // get this part's headers
                                                // start 1 line after the 
cookie, and end with the first blank line
                                                // part header starts next line 
after the boundary/cookie
!                                               
$info->parts[$new_part_idx]->custom['header_start'] = $x+1;
                                                $part_header_blob = '';
                                                for ($y=$x+1; $y < 
count($this->body_array) ;$y++)
--- 780,794 ----
                                                $new_part_idx = 
count($info->parts);
                                                $info->parts[$new_part_idx] = 
new msg_structure;
! 
!                                               $tmp_new_part_idx = 
$info->parts[$new_part_idx];
!                                               $tmp_new_part_idx->bytes = 0;
!                                               
$tmp_new_part_idx->custom['top_level'] = False;
!                                               
$tmp_new_part_idx->custom['parent_cookie'] = $info->custom['my_cookie'];
                                                // state info: we are now "IN" 
doing multi part detection on this part
!                                               
$tmp_new_part_idx->custom['detect_state'] = 'in';
                                                // get this part's headers
                                                // start 1 line after the 
cookie, and end with the first blank line
                                                // part header starts next line 
after the boundary/cookie
!                                               
$tmp_new_part_idx->custom['header_start'] = $x+1;
                                                $part_header_blob = '';
                                                for ($y=$x+1; $y < 
count($this->body_array) ;$y++)
***************
*** 791,795 ****
                                                                // reached end 
of this part's headers
                                                                // headers 
actually ended 1 line above this blank line
!                                                               
$info->parts[$new_part_idx]->custom['header_end'] = (int)($y-1);
                                                                // break out of 
this sub loop
                                                                break;
--- 804,808 ----
                                                                // reached end 
of this part's headers
                                                                // headers 
actually ended 1 line above this blank line
!                                                               
$tmp_new_part_idx->custom['header_end'] = (int)($y-1);
                                                                // break out of 
this sub loop
                                                                break;
***************
*** 809,816 ****
                                                // since we just passed the 
headers, and this is NOT a final boundary
                                                // this MUST be a start point 
for the next part
!                                               
$info->parts[$new_part_idx]->custom['part_start'] = (int)($y+1);
                                                // fill the conventional info 
on this fetchstructure sub-part
                                                // NOTE: first param to 
sub_get_structure is a REFERENCE
!                                               
$this->sub_get_structure(&$info->parts[$new_part_idx],$part_header_array);
                                                // ADVANCE INDEX $x TO AFTER 
WHAT WE'VE ALREADY LOOKED AT
                                                if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: advance x from ['.$x.'] 
to ['.$y.']<br>'; }
--- 822,832 ----
                                                // since we just passed the 
headers, and this is NOT a final boundary
                                                // this MUST be a start point 
for the next part
!                                               
$tmp_new_part_idx->custom['part_start'] = (int)($y+1);
                                                // fill the conventional info 
on this fetchstructure sub-part
                                                // NOTE: first param to 
sub_get_structure is a REFERENCE
!                                               
$this->sub_get_structure(&$tmp_new_part_idx,$part_header_array);
!                                               $info->parts[$new_part_idx] = 
$tmp_new_part_idx;
!                                               unset($tmp_new_part_idx);
!                                               
                                                // ADVANCE INDEX $x TO AFTER 
WHAT WE'VE ALREADY LOOKED AT
                                                if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: advance x from ['.$x.'] 
to ['.$y.']<br>'; }
***************
*** 822,836 ****
                                                // we found the CLOSING BOUNDARY
                                                $cur_part_idx = 
count($info->parts) - 1;
!                                               
$info->parts[$cur_part_idx]->custom['part_end'] = $x-1;
                                                // --Bytes-- we have a running 
total of byte size, but in testing against UWash, I was over by 2 bytes, so fix 
that
!                                               
$info->parts[$cur_part_idx]->bytes = $info->parts[$cur_part_idx]->bytes - 2;
                                                // --Lines-- we know beginning 
line and ending line, so calculate # lines for this part
!                                               
$info->parts[$cur_part_idx]->lines = 
$info->parts[$cur_part_idx]->custom['part_end'] - 
$info->parts[$cur_part_idx]->custom['part_start'];
!                                               
$info->parts[$cur_part_idx]->custom['detect_state'] = 'out';
                                                // we are DONE with this part 
for now 
!                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: final boundary at 
['.(string)($x-1).'] byte cumula: ['.$info->parts[$cur_part_idx]->bytes.'] 
lines: ['.$info->parts[$cur_part_idx]->lines.']<br>'; }
                                                // unset any unfilled elements
                                                // NOTE: param to  
unset_unfilled_fetchstructure  is a REFERENCE
!                                               
$this->unset_unfilled_fetchstructure(&$info->parts[$cur_part_idx]);
                                        }
                                        else
--- 838,856 ----
                                                // we found the CLOSING BOUNDARY
                                                $cur_part_idx = 
count($info->parts) - 1;
!                                               $tmp_cur_part_idx = 
$info->parts[$cur_part_idx];
!                                               
!                                               
$tmp_cur_part_idx->custom['part_end'] = $x-1;
                                                // --Bytes-- we have a running 
total of byte size, but in testing against UWash, I was over by 2 bytes, so fix 
that
!                                               $tmp_cur_part_idx->bytes = 
$tmp_cur_part_idx->bytes - 2;
                                                // --Lines-- we know beginning 
line and ending line, so calculate # lines for this part
!                                               $tmp_cur_part_idx->lines = 
$tmp_cur_part_idx->custom['part_end'] - $tmp_cur_part_idx->custom['part_start'];
!                                               
$tmp_cur_part_idx->custom['detect_state'] = 'out';
                                                // we are DONE with this part 
for now 
!                                               if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: final boundary at 
['.(string)($x-1).'] byte cumula: ['.$tmp_cur_part_idx->bytes.'] lines: 
['.$tmp_cur_part_idx->lines.']<br>'; }
                                                // unset any unfilled elements
                                                // NOTE: param to  
unset_unfilled_fetchstructure  is a REFERENCE
!                                               
$this->unset_unfilled_fetchstructure(&$tmp_cur_part_idx);
!                                               $info->parts[$cur_part_idx] = 
$tmp_cur_part_idx;
!                                               unset($tmp_cur_part_idx);
                                        }
                                        else
***************
*** 838,849 ****
                                                // running byte size of this 
part (if any)
                                                $cur_part_idx = 
count($info->parts) - 1;
!                                               if 
((isset($info->parts[$cur_part_idx]))
!                                               && 
($info->parts[$cur_part_idx]->custom['detect_state'] == 'in'))
                                                {
                                                        // previous count
!                                                       $prev_bytes = 
$info->parts[$cur_part_idx]->bytes;
                                                        // add new count, +2 
for the \r\n that will end the line when we feed it to the client
                                                        $add_bytes = 
strlen($body_line) + 2;
!                                                       
$info->parts[$cur_part_idx]->bytes = $prev_bytes + $add_bytes;
                                                }
                                        }
--- 858,875 ----
                                                // running byte size of this 
part (if any)
                                                $cur_part_idx = 
count($info->parts) - 1;
!                                               if 
(isset($info->parts[$cur_part_idx]))
!                                               {
!                                                       $tmp_cur_part_idx = 
$info->parts[$cur_part_idx];
!                                               }
!                                               if ((isset($tmp_cur_part_idx))
!                                               && 
($tmp_cur_part_idx->custom['detect_state'] == 'in'))
                                                {
                                                        // previous count
!                                                       $prev_bytes = 
$tmp_cur_part_idx->bytes;
                                                        // add new count, +2 
for the \r\n that will end the line when we feed it to the client
                                                        $add_bytes = 
strlen($body_line) + 2;
!                                                       
$tmp_cur_part_idx->bytes = $prev_bytes + $add_bytes;
!                                                       
$info->parts[$cur_part_idx] = $tmp_cur_part_idx;
!                                                       
unset($tmp_cur_part_idx);
                                                }
                                        }
***************
*** 877,888 ****
                                $enc_part_idx = count($info->parts);
                                $info->parts[$enc_part_idx] = new msg_structure;
!                               $info->parts[$enc_part_idx]->bytes = 0;
!                               
$info->parts[$enc_part_idx]->custom['top_level'] = False;
                                // ??? encapsulated part's parent does not have 
a boundary ???
!                               
$info->parts[$enc_part_idx]->custom['parent_cookie'] = '';
                                
                                // 2) Get This Part's Headers
                                // encapsulated headers begin immediately in 
the encapsulated part
!                               
$info->parts[$enc_part_idx]->custom['header_start'] = $range_start;
                                // encapsulated headers end with the 1st blank 
line
                                $part_header_blob = '';
--- 903,917 ----
                                $enc_part_idx = count($info->parts);
                                $info->parts[$enc_part_idx] = new msg_structure;
! 
!                               $tmp_enc_part_idx = $info->parts[$enc_part_idx];
! 
!                               $tmp_enc_part_idx->bytes = 0;
!                               $tmp_enc_part_idx->custom['top_level'] = False;
                                // ??? encapsulated part's parent does not have 
a boundary ???
!                               $tmp_enc_part_idx->custom['parent_cookie'] = '';
                                
                                // 2) Get This Part's Headers
                                // encapsulated headers begin immediately in 
the encapsulated part
!                               $tmp_enc_part_idx->custom['header_start'] = 
$range_start;
                                // encapsulated headers end with the 1st blank 
line
                                $part_header_blob = '';
***************
*** 899,903 ****
                                                // reached end of this part's 
headers
                                                // headers actually ended 1 
line above this blank line
!                                               
$info->parts[$enc_part_idx]->custom['header_end'] = (int)($y-1);
                                                // break out of this sub loop
                                                break;
--- 928,932 ----
                                                // reached end of this part's 
headers
                                                // headers actually ended 1 
line above this blank line
!                                               
$tmp_enc_part_idx->custom['header_end'] = (int)($y-1);
                                                // break out of this sub loop
                                                break;
***************
*** 919,923 ****
                                // fill the conventional info on this 
fetchstructure sub-part
                                // NOTE: first param to sub_get_structure is a 
REFERENCE
!                               
$this->sub_get_structure(&$info->parts[$enc_part_idx],$part_header_array);
                                
                                // ==  CONTROVESTIAL DEFAULT UWASH VALUE 
ASSIGNMENTS  ==
--- 948,952 ----
                                // fill the conventional info on this 
fetchstructure sub-part
                                // NOTE: first param to sub_get_structure is a 
REFERENCE
!                               
$this->sub_get_structure(&$tmp_enc_part_idx,$part_header_array);
                                
                                // ==  CONTROVESTIAL DEFAULT UWASH VALUE 
ASSIGNMENTS  ==
***************
*** 928,937 ****
                                // in fact UWash *may* fill a default subtype 
if a type IS specified (it's in the UWash code)
                                // so I will imitate UWash IMAP and assign a 
subtype of "plain" when NO type is specified
!                               if 
((!isset($info->parts[$enc_part_idx]->subtype))
!                               || 
((string)$info->parts[$enc_part_idx]->subtype == ''))
                                {
                                        if ($this->debug_dcom >= 2) { echo 
'pop3: create_embeded_fetchstructure: enc mime loop: CONTROVERSIAL uwash 
imitation: adding subtype "plain" to immediate RFC822 child part, none was 
specified<br>'; }
!                                       $info->parts[$enc_part_idx]->ifsubtype 
= True;
!                                       $info->parts[$enc_part_idx]->subtype = 
'plain';
                                }
                                // (B) PARAM "charset=US-ASCII" 
--- 957,966 ----
                                // in fact UWash *may* fill a default subtype 
if a type IS specified (it's in the UWash code)
                                // so I will imitate UWash IMAP and assign a 
subtype of "plain" when NO type is specified
!                               if ((!isset($tmp_enc_part_idx->subtype))
!                               || ((string)$tmp_enc_part_idx->subtype == ''))
                                {
                                        if ($this->debug_dcom >= 2) { echo 
'pop3: create_embeded_fetchstructure: enc mime loop: CONTROVERSIAL uwash 
imitation: adding subtype "plain" to immediate RFC822 child part, none was 
specified<br>'; }
!                                       $tmp_enc_part_idx->ifsubtype = True;
!                                       $tmp_enc_part_idx->subtype = 'plain';
                                }
                                // (B) PARAM "charset=US-ASCII" 
***************
*** 939,949 ****
                                // I know it hurts, but I'm just copying UWash 
!!!
                                $found_charset = False;
!                               for ($ux=0; $ux < 
count($info->parts[$enc_part_idx]->parameters) ;$ux++)
                                {
!                                       if 
(stristr($info->parts[$enc_part_idx]->parameters[$new_idx]->attribute,'charset'))
                                        {
                                                $found_charset = True;
                                                break;
                                        }
                                }
                                // do that crappy adding of charset param if 
necessary
--- 968,981 ----
                                // I know it hurts, but I'm just copying UWash 
!!!
                                $found_charset = False;
!                               for ($ux=0; $ux < 
count($tmp_enc_part_idx->parameters) ;$ux++)
                                {
!                                       
!                                       $tmp_enc_params = 
$tmp_enc_part_idx->parameters[$new_idx];
!                                       if 
(stristr($tmp_enc_params->attribute,'charset'))
                                        {
                                                $found_charset = True;
                                                break;
                                        }
+                                       unset($tmp_enc_params);
                                }
                                // do that crappy adding of charset param if 
necessary
***************
*** 951,957 ****
                                {
                                        if ($this->debug_dcom >= 2) { echo 
'pop3: create_embeded_fetchstructure: enc mime loop: CONTROVERSIAL uwash 
imitation: adding param "charset=US-ASCII" to immediate RFC822 child part, none 
was specified<br>'; }
!                                       $new_idx = 
count($info->parts[$enc_part_idx]->parameters);
!                                       
$info->parts[$enc_part_idx]->parameters[$new_idx] = new 
msg_params('charset','US-ASCII');
!                                       
$info->parts[$enc_part_idx]->ifparameters = true;
                                }
                                // ends CONTROVESTIAL uwash inmitation code
--- 983,989 ----
                                {
                                        if ($this->debug_dcom >= 2) { echo 
'pop3: create_embeded_fetchstructure: enc mime loop: CONTROVERSIAL uwash 
imitation: adding param "charset=US-ASCII" to immediate RFC822 child part, none 
was specified<br>'; }
!                                       $new_idx = 
count($tmp_enc_part_idx->parameters);
!                                       $tmp_enc_part_idx->parameters[$new_idx] 
= new msg_params('charset','US-ASCII');
!                                       $tmp_enc_part_idx->ifparameters = true;
                                }
                                // ends CONTROVESTIAL uwash inmitation code
***************
*** 959,969 ****
                                // 3) fill Part Start and Part End
                                // encapsulated body STARTS at the first line 
after the blank line header sep above
!                               
$info->parts[$enc_part_idx]->custom['part_start'] = (int)($y+1);
                                // encapsulated body ENDS at the end of the 
partnts range
!                               $info->parts[$enc_part_idx]->custom['part_end'] 
= $range_end;
  
                                // 4) calculate byte size and # of lines of the 
content within this parts start and end
!                               $my_start = 
$info->parts[$enc_part_idx]->custom['part_start'];
!                               $my_end = 
$info->parts[$enc_part_idx]->custom['part_end'];
                                if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: enc mime loop: this body range ['.$my_start.'] 
to ['.$my_end.']<br>'; }
                                for ($x=$my_start; $x < $my_end+1 ;$x++)
--- 991,1001 ----
                                // 3) fill Part Start and Part End
                                // encapsulated body STARTS at the first line 
after the blank line header sep above
!                               $tmp_enc_part_idx->custom['part_start'] = 
(int)($y+1);
                                // encapsulated body ENDS at the end of the 
partnts range
!                               $tmp_enc_part_idx->custom['part_end'] = 
$range_end;
  
                                // 4) calculate byte size and # of lines of the 
content within this parts start and end
!                               $my_start = 
$tmp_enc_part_idx->custom['part_start'];
!                               $my_end = $tmp_enc_part_idx->custom['part_end'];
                                if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: enc mime loop: this body range ['.$my_start.'] 
to ['.$my_end.']<br>'; }
                                for ($x=$my_start; $x < $my_end+1 ;$x++)
***************
*** 973,987 ****
                                        if ($this->debug_dcom >= 2) { echo 
'pop3: encap mime size loop ['.$x.']: '.htmlspecialchars($body_line).'<br>'; }
                                        // prevoius count
!                                       $prev_bytes = 
$info->parts[$enc_part_idx]->bytes;
                                        // add new count, +2 for the \r\n that 
will end the line when we feed it to the client
                                        $add_bytes = strlen($body_line) + 2;
!                                       $info->parts[$enc_part_idx]->bytes = 
$prev_bytes + $add_bytes;
                                }
                                // --Bytes-- we made a running total of byte 
size, but in testing against UWash, I was over by 2 bytes, so fix that
!                               $info->parts[$enc_part_idx]->bytes = 
$info->parts[$enc_part_idx]->bytes - 2;
                                // --Lines-- we know beginning line and ending 
line, so calculate # lines for this part
!                               $info->parts[$enc_part_idx]->lines = $my_end - 
$my_start;
                                // we're done with the loop so the bytes have 
been calculated in that loop
!                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: this part range byte size 
['.$info->parts[$enc_part_idx]->bytes.'] lines: 
['.$info->parts[$enc_part_idx]->lines.']<br>'; }
                        }
                        // no embedded parts, why not?
--- 1005,1022 ----
                                        if ($this->debug_dcom >= 2) { echo 
'pop3: encap mime size loop ['.$x.']: '.htmlspecialchars($body_line).'<br>'; }
                                        // prevoius count
!                                       $prev_bytes = $tmp_enc_part_idx->bytes;
                                        // add new count, +2 for the \r\n that 
will end the line when we feed it to the client
                                        $add_bytes = strlen($body_line) + 2;
!                                       $tmp_enc_part_idx->bytes = $prev_bytes 
+ $add_bytes;
                                }
                                // --Bytes-- we made a running total of byte 
size, but in testing against UWash, I was over by 2 bytes, so fix that
!                               $tmp_enc_part_idx->bytes = 
$tmp_enc_part_idx->bytes - 2;
                                // --Lines-- we know beginning line and ending 
line, so calculate # lines for this part
!                               $tmp_enc_part_idx->lines = $my_end - $my_start;
!                               
                                // we're done with the loop so the bytes have 
been calculated in that loop
!                               if ($this->debug_dcom >= 2) { echo 'pop3: 
create_embeded_fetchstructure: this part range byte size 
['.$tmp_enc_part_idx->bytes.'] lines: ['.$tmp_enc_part_idx->lines.']<br>'; }
!                               $info->parts[$enc_part_idx] = $tmp_enc_part_idx;
!                               unset($tmp_enc_part_idx);
                        }
                        // no embedded parts, why not?
***************
*** 1972,1977 ****
                                // return part one
                                if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchbody: returning part '.$part_num.', internally ['.$the_part.']<br>'; }
!                               if 
((!isset($this->msg_structure->parts[$the_part]->custom['part_start']))
!                               || 
(!isset($this->msg_structure->parts[$the_part]->custom['part_start'])))
                                {
                                        if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: ERROR: required part data not present for '.$part_num.', 
internally ['.$the_part.']<br>'; }
--- 2007,2015 ----
                                // return part one
                                if ($this->debug_dcom >= 1) { echo 'pop3: 
fetchbody: returning part '.$part_num.', internally ['.$the_part.']<br>'; }
! 
!                               $tmp_msg_structure_parts = 
$this->msg_structure->parts[$the_part];
! 
!                               if 
((address@hidden($tmp_msg_structure_parts->custom['part_start']))
!                               || 
(!isset($tmp_msg_structure_parts->custom['part_start'])))
                                {
                                        if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: ERROR: required part data not present for '.$part_num.', 
internally ['.$the_part.']<br>'; }
***************
*** 1983,1988 ****
                                {
                                        // attempt to make the part
!                                       $part_start = 
(int)$this->msg_structure->parts[$the_part]->custom['part_start'];
!                                       $part_end = 
(int)$this->msg_structure->parts[$the_part]->custom['part_end'];
                                        if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: returning part '.$part_num.' starts ['.$part_start.'] ends 
['.$part_end.']<br>'; }
                                        // assemble the body [art part
--- 2021,2026 ----
                                {
                                        // attempt to make the part
!                                       $part_start = 
(int)$tmp_msg_structure_parts->custom['part_start'];
!                                       $part_end = 
(int)$tmp_msg_structure_parts->custom['part_end'];
                                        if ($this->debug_dcom >= 1) { echo 
'pop3: fetchbody: returning part '.$part_num.' starts ['.$part_start.'] ends 
['.$part_end.']<br>'; }
                                        // assemble the body [art part
***************
*** 1993,1996 ****
--- 2031,2036 ----
                                        }
                                }
+ //                            $this->msg_structure->parts[$the_part] = 
$tmp_msg_structure_parts;
+ //                            unset($tmp_msg_structure_parts);
                        }
                        // handle multiple parts
***************
*** 2008,2016 ****
                                // build the recursive parts structure to 
obtain this parts data
                                // use REFERENCES to do this
!                               $temp_part = &$this->msg_structure;
                                for($i=0;$i < count($the_part_array);$i++)
                                {
                                        $target_part = 
$temp_part->parts[$the_part_array[$i]];
!                                       $temp_part = &$target_part;
                                }
                                // verify part data exists
--- 2048,2056 ----
                                // build the recursive parts structure to 
obtain this parts data
                                // use REFERENCES to do this
!                               $temp_part = $this->msg_structure;
                                for($i=0;$i < count($the_part_array);$i++)
                                {
                                        $target_part = 
$temp_part->parts[$the_part_array[$i]];
!                                       $temp_part = $target_part;
                                }
                                // verify part data exists




reply via email to

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