phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: felamimail/inc array.php,1.3,1.4 auth.php,1.3,1.


From: Lars Kneschke <address@hidden>
Subject: [Phpgroupware-cvs] CVS: felamimail/inc array.php,1.3,1.4 auth.php,1.3,1.4 class.bocaching.inc.php,1.3,1.4 class.bocompose.inc.php,1.3,1.4 class.bofelamimail.inc.php,1.5,1.6 class.bopreferences.inc.php,1.4,1.5 class.phpmailer.inc.php,1.1.1.1,1.2 class.smtp.php,1.1.1.1,1.2 class.socaching.inc.php,1.3,1.4 class.sofelamimail.inc.php,1.3,1.4 class.transformdate.inc.php,1.3,1.4 class.uicompose.inc.php,1.3,1.4 class.uifelamimail.inc.php,1.5,1.6 date.php,1.3,1.4 display_messages.php,1.3,1.4 hook_admin.inc.php,1.5,1.6 hook_home.inc.php,1.7,1.8 hook_preferences.inc.php,1.7,1.8 i18n.php,1.3,1.4 imap.php,1.3,1.4 imap_general.php,1.3,1.4 imap_mailbox.php,1.3,1.4 imap_messages.php,1.3,1.4 imap_search.php,1.3,1.4 mailbox_display.php,1.3,1.4 mime.php,1.3,1.4 page_header.php,1.3,1.4 plugin.php,1.3,1.4 prefs.php,1.3,1.4 smtp.php,1.3,1.4 strings.php,1.3,1.4 tree.php,1.3,1.4 url_parser.php,1.3,1.4
Date: Sat, 23 Nov 2002 19:32:17 -0500

Update of /cvsroot/phpgroupware/felamimail/inc
In directory subversions:/tmp/cvs-serv28374/inc

Modified Files:
        array.php auth.php class.bocaching.inc.php 
        class.bocompose.inc.php class.bofelamimail.inc.php 
        class.bopreferences.inc.php class.phpmailer.inc.php 
        class.smtp.php class.socaching.inc.php 
        class.sofelamimail.inc.php class.transformdate.inc.php 
        class.uicompose.inc.php class.uifelamimail.inc.php date.php 
        display_messages.php hook_admin.inc.php hook_home.inc.php 
        hook_preferences.inc.php i18n.php imap.php imap_general.php 
        imap_mailbox.php imap_messages.php imap_search.php 
        mailbox_display.php mime.php page_header.php plugin.php 
        prefs.php smtp.php strings.php tree.php url_parser.php 
Log Message:
updated head to my current devel version


Index: array.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/array.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: auth.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/auth.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: class.bocaching.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.bocaching.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.bocaching.inc.php     27 Mar 2002 22:06:44 -0000      1.3
--- class.bocaching.inc.php     24 Nov 2002 00:32:13 -0000      1.4
***************
*** 76,82 ****
                }
                
!               function getHeaders($_firstMessage='', $_numberOfMessages='' 
,$_sort='')
                {
!                       return $this->socaching->getHeaders($_firstMessage, 
$_numberOfMessages, $_sort);
                }
                
--- 76,82 ----
                }
                
!               function getHeaders($_firstMessage='', $_numberOfMessages='' 
,$_sort='', $_filter='')
                {
!                       return $this->socaching->getHeaders($_firstMessage, 
$_numberOfMessages, $_sort, $_filter);
                }
                
***************
*** 94,97 ****
--- 94,104 ----
                        return $retValue;
  
+               }
+               
+               // return the numbers of messages in cache currently
+               // but use the use filter
+               function getMessageCounter($_filter)
+               {
+                       return $this->socaching->getMessageCounter($_filter);
                }
  

Index: class.bocompose.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.bocompose.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.bocompose.inc.php     27 Mar 2002 22:06:44 -0000      1.3
--- class.bocompose.inc.php     24 Nov 2002 00:32:13 -0000      1.4
***************
*** 100,103 ****
--- 100,104 ----
                        
                        $this->saveSessionData();
+                       #print"<pre>";print_r($this->sessionData);print"</pre>";
                }
                
***************
*** 118,132 ****
                }
                
!               function getForwardData($_folder, $_replyID)
                {
!                       $bofelamimail    = 
CreateObject('felamimail.bofelamimail',$_folder);
                        
                        // get message headers for specified message
!                       $headers        = 
$bofelamimail->getMessageHeaders($_replyID);
                        
                        // check for Re: in subject header
                        $this->sessionData['subject'] = "[FWD: " . 
$bofelamimail->decode_header($headers->Subject)."]";
  
!                       $structure     = 
$bofelamimail->getMessageStructure($_replyID);
                        if(sizeof($structure->parts) > 1)
                        {
--- 119,134 ----
                }
                
!               function getForwardData($_uid)
                {
!                       $bofelamimail    = 
CreateObject('felamimail.bofelamimail');
!                       $bofelamimail->openConnection();
                        
                        // get message headers for specified message
!                       $headers        = 
$bofelamimail->getMessageHeader($_uid);
                        
                        // check for Re: in subject header
                        $this->sessionData['subject'] = "[FWD: " . 
$bofelamimail->decode_header($headers->Subject)."]";
  
!                       $structure     = 
$bofelamimail->getMessageStructure($_uid, ST_UID);
                        if(sizeof($structure->parts) > 1)
                        {
***************
*** 141,145 ****
                        
                        // iterate through message parts
!                       if(is_array($sections))
                        {
                                for($x=0; $x<sizeof($sections); $x++)
--- 143,153 ----
                        
                        // iterate through message parts
!                       // get the body
!                       $bodyParts = $bofelamimail->getMessageBody($_uid);
!                       for($i=0; $i<count($bodyParts); $i++)
!                       {
!                               $this->sessionData['body']      .= 
$bodyParts[$i];
!                       }
! /*                    if(is_array($sections))
                        {
                                for($x=0; $x<sizeof($sections); $x++)
***************
*** 149,153 ****
                                                != "attachment")
                                        {
!                                               $bodyPart = 
$bofelamimail->getMessageBody($_replyID, $sections[$x]["pid"]);
                                                $this->sessionData['body'] .= 
quoted_printable_decode($bodyPart);
                                        }
--- 157,161 ----
                                                != "attachment")
                                        {
!                                               $bodyPart = 
$bofelamimail->getMessageBody($_uid, $sections[$x]["pid"], ST_UID);
                                                $this->sessionData['body'] .= 
quoted_printable_decode($bodyPart);
                                        }
***************
*** 156,162 ****
                        else
                        {
!                               $this->sessionData['body']      .= 
$bofelamimail->getMessageBody($_replyID);
                        }
!                                                                               
                                                
                        $this->sessionData['body']       .= "\n\n               
   -----------Originalnachricht-----------\n\n";
                                        
--- 164,170 ----
                        else
                        {
!                               $this->sessionData['body']      .= 
$bofelamimail->getMessageBody($_uid, '', ST_UID);
                        }
! */                                                                            
                                                
                        $this->sessionData['body']       .= "\n\n               
   -----------Originalnachricht-----------\n\n";
                                        
***************
*** 166,175 ****
                }
  
!               function getReplyData($_folder, $_replyID)
                {
!                       $bofelamimail    = 
CreateObject('felamimail.bofelamimail',$_folder);
                        
                        // get message headers for specified message
!                       $headers        = 
$bofelamimail->getMessageHeaders($_replyID);
                        
                        // check for Reply-To: header and use if available
--- 174,189 ----
                }
  
!               // $_mode can be:
!               // single: for a reply to one address
!               // all: for a reply to all
!               function getReplyData($_mode, $_uid)
                {
!                       $bofelamimail    = 
CreateObject('felamimail.bofelamimail');
!                       $bofelamimail->openConnection();
                        
                        // get message headers for specified message
!                       $headers        = 
$bofelamimail->getMessageHeader($_uid);
! 
!                       $this->sessionData['uid'] = $_uid;
                        
                        // check for Reply-To: header and use if available
***************
*** 183,186 ****
--- 197,263 ----
                        }
                        
+                       if($_mode == 'all')
+                       {
+                               #_debug_array($this->preferences);
+                               // reply to any address which is cc, but not to 
my self
+                               $oldCC = 
$bofelamimail->decode_header(trim($headers->ccaddress));
+                               $addressParts = 
imap_rfc822_parse_adrlist($oldCC, '');
+                               if (count($addressParts)>0)
+                               {
+                                       while(list($key,$val) = 
each($addressParts))
+                                       {
+                                               if($val->mailbox.'@'.$val->host 
== $this->preferences['emailAddress'])
+                                               {
+                                                       continue;
+                                               }
+                                               
if(!empty($this->sessionData['cc'])) $this->sessionData['cc'] .= ",";
+                                               if(!empty($val->personal))
+                                               {
+                                                       
$this->sessionData['cc'] .= sprintf('"%s" <address@hidden>',
+                                                                               
        $val->personal,
+                                                                               
        $val->mailbox,
+                                                                               
        $val->host);
+                                               }
+                                               else
+                                               {
+                                                       
$this->sessionData['cc'] .= sprintf("address@hidden",
+                                                                               
        $val->mailbox,
+                                                                               
        $val->host);
+                                               }
+                                       }
+                               }
+                               
+                               
+                               // reply to any address which is to, but not to 
my self
+                               $oldTo = 
$bofelamimail->decode_header(trim($headers->toaddress));
+                               $addressParts = 
imap_rfc822_parse_adrlist($oldTo, '');
+                               if (count($addressParts)>0)
+                               {
+                                       while(list($key,$val) = 
each($addressParts))
+                                       {
+                                               if($val->mailbox.'@'.$val->host 
== $this->preferences['emailAddress'])
+                                               {
+                                                       continue;
+                                               }
+                                               #print 
$val->mailbox.'@'.$val->host."<br>";
+                                               
if(!empty($this->sessionData['to'])) $this->sessionData['to'] .= ", ";
+                                               if(!empty($val->personal))
+                                               {
+                                                       
$this->sessionData['to'] .= sprintf('"%s" <address@hidden>',
+                                                                               
        $val->personal,
+                                                                               
        $val->mailbox,
+                                                                               
        $val->host);
+                                               }
+                                               else
+                                               {
+                                                       
$this->sessionData['to'] .= sprintf("address@hidden",
+                                                                               
        $val->mailbox,
+                                                                               
        $val->host);
+                                               }
+                                       }
+                               }
+                       }
+                       
+                       
                        // check for Re: in subject header
                        if(strtolower(substr(trim($headers->Subject), 0, 3)) == 
"re:")
***************
*** 193,197 ****
                        }
  
!                       $structure     = 
$bofelamimail->getMessageStructure($_replyID);
                        if(sizeof($structure->parts) > 1)
                        {
--- 270,274 ----
                        }
  
!                       $structure = $bofelamimail->getMessageStructure($_uid);
                        if(sizeof($structure->parts) > 1)
                        {
***************
*** 200,224 ****
                        }
                        
!                       $this->sessionData['body']      = "On " . 
$headers->Date . ", you wrote: \n>";
                        
!                       // iterate through message parts
!                       if(is_array($sections))
                        {
!                               for($x=0; $x<sizeof($sections); $x++)
                                {
!                                       // if text type, display
!                                       if($sections[$x]["type"] == 
"text/plain" && $sections[$x]["disposition"] 
!                                               != "attachment")
!                                       {
!                                               $bodyPart = 
$bofelamimail->getMessageBody($_replyID, $sections[$x]["pid"]);
!                                               $bodyPart = 
quoted_printable_decode($bodyPart);
!                                               $this->sessionData['body'] .= 
str_replace("\n", "\n>", $bodyPart);
!                                       }
                                }
                        }
-                       else
-                       {
-                               $this->sessionData['body']      .= 
str_replace("\n", "\n>", $bofelamimail->getMessageBody($_replyID));
-                       }
                                                                                
                                                
                                        
--- 277,301 ----
                        }
                        
!                       $this->sessionData['body']      = lang("on")." " . 
$headers->Date . ", ".lang("you wrote").": \n>";
                        
!                       // get the body
!                       $bodyParts = $bofelamimail->getMessageBody($_uid);
! 
!                       for($i=0; $i<count($bodyParts); $i++)
                        {
!                               if(!empty($this->sessionData['body'])) 
$$this->sessionData['body'] .= "\n\n";
!                               // add line breaks to $bodyParts
!                               $newBody        = explode("\n",$bodyParts[$i]);
!                               
!                               // create it new, with good line breaks
!                               reset($newBody);
!                               while(list($key,$value) = @each($newBody))
                                {
!                                       $value .= "\n";
!                                       $bodyAppend = 
wordwrap($value,70,"\n",1);
!                                       $bodyAppend = str_replace("\n", "\n>", 
$bodyAppend);
!                                       $this->sessionData['body'] .= 
htmlentities($bodyAppend);
                                }
                        }
                                                                                
                                                
                                        
***************
*** 232,235 ****
--- 309,319 ----
                        return $this->sessionData;
                }
+ 
+               // get the user name, will will use for the FROM field
+               function getUserName()
+               {
+                       $retData = sprintf("%s 
<%s>",$this->preferences['realname'],$this->preferences['emailAddress']);
+                       return $retData;
+               }
                
                function removeAttachment($_formData)
***************
*** 264,267 ****
--- 348,352 ----
                {
                        $this->sessionData = 
$GLOBALS['phpgw']->session->appsession('compose_session_data_'.$this->composeID);
+                       #print "bocompose after 
restore<pre>";print_r($this->sessionData);print"</pre>";
                }
                
***************
*** 282,287 ****
                        $this->sessionData['signature'] = 
$_formData['signature'];
  
                        $mail = CreateObject('felamimail.phpmailer');
!                       #_debug_array($this->preferences);
                        
                        #include(PHPGW_APP_ROOT . "/config/config.php");
--- 367,378 ----
                        $this->sessionData['signature'] = 
$_formData['signature'];
  
+ 
                        $mail = CreateObject('felamimail.phpmailer');
!                       
!                       #print $this->sessionData['uid']."<bR>";
!                       #print $this->sessionData['folder']."<bR>";
!                       
!                       #_debug_array($_formData);
!                       #exit;
                        
                        #include(PHPGW_APP_ROOT . "/config/config.php");
***************
*** 293,307 ****
                        $mail->Priority = $this->sessionData['priority'];
                        $mail->Encoding = '8bit';
  
                        if (!empty($this->sessionData['to']))
                        {
!                               $address = split(",",$this->sessionData['to']);
!                               while (list($key,$value) = each($address))
                                {
!                                       $address_array  = 
imap_rfc822_parse_adrlist($value,'');
!                                       if(count($address_array)>0)
                                        {
!                                               $emailAddress = 
$address_array[0]->mailbox."@".$address_array[0]->host;
!                                               $emailName = 
$address_array[0]->personal;
                                                
$mail->AddAddress($emailAddress,$emailName);
                                        }
--- 384,398 ----
                        $mail->Priority = $this->sessionData['priority'];
                        $mail->Encoding = '8bit';
+                       $mail->PluginDir = PHPGW_SERVER_ROOT."/felamimail/inc/";
  
                        if (!empty($this->sessionData['to']))
                        {
!                               $address_array  = 
imap_rfc822_parse_adrlist($this->sessionData['to'],'');
!                               if(count($address_array)>0)
                                {
!                                       for($i=0;$i<count($address_array);$i++)
                                        {
!                                               $emailAddress = 
$address_array[$i]->mailbox."@".$address_array[$i]->host;
!                                               $emailName = 
$address_array[$i]->personal;
                                                
$mail->AddAddress($emailAddress,$emailName);
                                        }
***************
*** 311,322 ****
                        if (!empty($this->sessionData['cc']))
                        {
!                               $address = split(",",$this->sessionData['cc']);
!                               while (list($key,$value) = each($address))
                                {
!                                       $address_array  = 
imap_rfc822_parse_adrlist($value,'');
!                                       if(count($address_array)>0)
                                        {
!                                               $emailAddress = 
$address_array[0]->mailbox."@".$address_array[0]->host;
!                                               $emailName = 
$address_array[0]->personal;
                                                
$mail->AddCC($emailAddress,$emailName);
                                        }
--- 402,412 ----
                        if (!empty($this->sessionData['cc']))
                        {
!                               $address_array  = 
imap_rfc822_parse_adrlist($this->sessionData['cc'],'');
!                               if(count($address_array)>0)
                                {
!                                       for($i=0;$i<count($address_array);$i++)
                                        {
!                                               $emailAddress = 
$address_array[$i]->mailbox."@".$address_array[$i]->host;
!                                               $emailName = 
$address_array[$i]->personal;
                                                
$mail->AddCC($emailAddress,$emailName);
                                        }
***************
*** 326,337 ****
                        if (!empty($this->sessionData['bcc']))
                        {
!                               $address = split(",",$this->sessionData['bcc']);
!                               while (list($key,$value) = each($address))
                                {
!                                       $address_array  = 
imap_rfc822_parse_adrlist($value,'');
!                                       if(count($address_array)>0)
                                        {
!                                               $emailAddress = 
$address_array[0]->mailbox."@".$address_array[0]->host;
!                                               $emailName = 
$address_array[0]->personal;
                                                
$mail->AddBCC($emailAddress,$emailName);
                                        }
--- 416,426 ----
                        if (!empty($this->sessionData['bcc']))
                        {
!                               $address_array  = 
imap_rfc822_parse_adrlist($this->sessionData['bcc'],'');
!                               if(count($address_array)>0)
                                {
!                                       for($i=0;$i<count($address_array);$i++)
                                        {
!                                               $emailAddress = 
$address_array[$i]->mailbox."@".$address_array[$i]->host;
!                                               $emailName = 
$address_array[$i]->personal;
                                                
$mail->AddBCC($emailAddress,$emailName);
                                        }
***************
*** 341,359 ****
                        if (!empty($this->sessionData['reply_to']))
                        {
!                               $address = 
split(",",$this->sessionData['reply_to']);
!                               while (list($key,$value) = each($address))
                                {
!                                       $address_array  = 
imap_rfc822_parse_adrlist($value,'');
!                                       if(count($address_array)>0)
!                                       {
!                                               $emailAddress = 
$address_array[0]->mailbox."@".$address_array[0]->host;
!                                               $emailName = 
$address_array[0]->personal;
!                                               
$mail->AddReplyTo($emailAddress,$emailName);
!                                       }
                                }
                        }
                        
                        $mail->WordWrap = 76;
!                       $mail->Subject = $this->sessionData['subject'];
                        $mail->IsHTML(false);
                        $mail->Body    = $this->sessionData['body'];
--- 430,444 ----
                        if (!empty($this->sessionData['reply_to']))
                        {
!                               $address_array  = 
imap_rfc822_parse_adrlist($this->sessionData['reply_to'],'');
!                               if(count($address_array)>0)
                                {
!                                       $emailAddress = 
$address_array[0]->mailbox."@".$address_array[0]->host;
!                                       $emailName = 
$address_array[0]->personal;
!                                       
$mail->AddReplyTo($emailAddress,$emailName);
                                }
                        }
                        
                        $mail->WordWrap = 76;
!                       $mail->Subject = 
"=?iso-8859-1?Q?".imap_8bit($this->sessionData['subject'])."?=";
                        $mail->IsHTML(false);
                        $mail->Body    = $this->sessionData['body'];
***************
*** 387,412 ****
                        if ($this->preferences['move_to_sent'] == "true")
                        {
!                               $username               = 
$this->preferences['username'];
!                               $key                    = 
$this->preferences['key'];
!                               $imapServerAddress      = 
$this->preferences['imapServerAddress'];
!                               $imapPort               = 
$this->preferences['imapPort'];
!                               $sent_folder            = 
$this->preferences['sent_folder'];
!                       
!                               include(PHPGW_APP_ROOT . 
"/inc/imap_general.php");
!                               include(PHPGW_APP_ROOT . 
"/inc/imap_mailbox.php");
!                               include(PHPGW_APP_ROOT . "/inc/smtp.php");
!                       
!                               $imap_stream = sqimap_login($username, $key, 
$imapServerAddress, $imapPort, 1);
!                               $sent_folder = trim($sent_folder);
!                               if (sqimap_mailbox_exists ($imap_stream, 
$sent_folder)) 
!                               {
!                                       sqimap_append ($imap_stream, 
$sent_folder, 
!                                               
strlen($mail->create_header())+strlen($mail->create_body()));
!                                       fputs ($imap_stream, 
$mail->create_header());
!                                       fputs ($imap_stream, 
$mail->create_body());
!                                       sqimap_append_done ($imap_stream);
!                               }
!                               sqimap_logout($imap_stream);
                        }
                        while(list($key,$value) = 
@each($this->sessionData['attachments']))
                        {
--- 472,491 ----
                        if ($this->preferences['move_to_sent'] == "true")
                        {
!                               // mark message as answered
!                               $bofelamimail = 
CreateObject('felamimail.bofelamimail',$this->sessionData['folder']);
!                               $bofelamimail->openConnection();
!                               
$bofelamimail->appendMessage($this->preferences['sent_folder'],$mail->header,$mail->body);
!                               $bofelamimail->closeConnection();
                        }
+ 
+                       if(isset($this->sessionData['uid']))
+                       {
+                               // mark message as answered
+                               $bofelamimail = 
CreateObject('felamimail.bofelamimail',$this->sessionData['folder']);
+                               $bofelamimail->openConnection();
+                               
$bofelamimail->flagMessages("answered",array('0' => $this->sessionData['uid']));
+                               $bofelamimail->closeConnection();
+                       }
+ 
                        while(list($key,$value) = 
@each($this->sessionData['attachments']))
                        {
***************
*** 430,436 ****
                        if (get_magic_quotes_gpc()) 
                        {
!                               $string = stripslashes($_string);
                        }
-                       return $string;
                }
                                
--- 509,518 ----
                        if (get_magic_quotes_gpc()) 
                        {
!                               return stripslashes($_string);
!                       }
!                       else
!                       {
!                               return $_string;
                        }
                }
                                

Index: class.bofelamimail.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.bofelamimail.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.bofelamimail.inc.php  26 Apr 2002 15:51:35 -0000      1.5
--- class.bofelamimail.inc.php  24 Nov 2002 00:32:13 -0000      1.6
***************
*** 31,52 ****
                var $encoding = array("7bit", "8bit", "binary", "base64", 
"quoted-printable", "other");
  
!               function bofelamimail($_foldername)
                {
!                       $this->foldername               = $_foldername;
!                       $this->accountid                = 
$GLOBALS['phpgw_info']['user']['account_id'];
! 
                        $this->bopreferences    = 
CreateObject('felamimail.bopreferences');
!                       $this->sofelamimail             = 
CreateObject('felamimail.sofelamimail');
! 
                        $this->mailPreferences  = 
$this->bopreferences->getPreferences();
!                       $this->imapBaseDir              = '';
! 
!                       $mailboxString = sprintf("{%s:%s}%s",
!                                       
$this->mailPreferences['imapServerAddress'],
!                                       $this->mailPreferences['imapPort'],
!                                       imap_utf7_encode($this->foldername));
! 
!                       $this->mbox = imap_open ($mailboxString, 
!                                       $this->mailPreferences['username'], 
$this->mailPreferences['key']);
                }
                
--- 31,75 ----
                var $encoding = array("7bit", "8bit", "binary", "base64", 
"quoted-printable", "other");
  
!               function bofelamimail()
                {
!                       $this->restoreSessionData();
!                       
!                       // set some defaults
!                       if(count($this->sessionData) == 0)
!                       {
!                               // this should be under user preferences
!                               // sessionData empty
!                               // no filter active
!                               $this->sessionData['activeFilter']      = "-1";
!                               // default mailbox INBOX
!                               $this->sessionData['mailbox']           = 
"INBOX";
!                               // default start message
!                               $this->sessionData['startMessage']      = 1;
!                               // default sorting
!                               
if(!empty($GLOBALS['phpgw_info']['user']['preferences']['felamimail']['sortOrder']))
!                               {
!                                       $this->sessionData['sort']      = 
$GLOBALS['phpgw_info']['user']['preferences']['felamimail']['sortOrder'];
!                               }
!                               else
!                               {
!                                       $this->sessionData['sort']      = 6;
!                               }
!                               $this->saveSessionData();
!                       }
!                       
!                       $this->foldername       = $this->sessionData['mailbox'];
!                       $this->accountid        = 
$GLOBALS['phpgw_info']['user']['account_id'];
!                       
                        $this->bopreferences    = 
CreateObject('felamimail.bopreferences');
!                       $this->sofelamimail     = 
CreateObject('felamimail.sofelamimail');
!                       
                        $this->mailPreferences  = 
$this->bopreferences->getPreferences();
!                       $this->imapBaseDir      = '';
!                       
!               }
!               
!               function appendMessage($_folder, $_header, $_body)
!               {
!                       imap_append($this->mbox, $_folder, $_header.$_body);
                }
                
***************
*** 63,67 ****
                        $trashFolder    = $prefs['trash_folder'];
                        
!                       if($this->foldername == $trashFolder && $deleteOptions 
== "move_to_trash")
                        {
                                // delete all messages in the trash folder
--- 86,90 ----
                        $trashFolder    = $prefs['trash_folder'];
                        
!                       if($this->sessionData['mailbox'] == $trashFolder && 
$deleteOptions == "move_to_trash")
                        {
                                // delete all messages in the trash folder
***************
*** 69,73 ****
                                                
$this->mailPreferences['imapServerAddress'],
                                                
$this->mailPreferences['imapPort'],
!                                               
imap_utf7_encode($this->foldername));
                                $status = imap_status ($this->mbox, 
$mailboxString, SA_ALL);
                                $numberOfMessages = $status->messages;
--- 92,96 ----
                                                
$this->mailPreferences['imapServerAddress'],
                                                
$this->mailPreferences['imapPort'],
!                                               
imap_utf7_encode($this->sessionData['mailbox']));
                                $status = imap_status ($this->mbox, 
$mailboxString, SA_ALL);
                                $numberOfMessages = $status->messages;
***************
*** 112,116 ****
                                        
$this->mailPreferences['imapServerAddress'],
                                        $this->mailPreferences['username'],
!                                       $this->foldername);
  
                        reset($_messageUID);
--- 135,139 ----
                                        
$this->mailPreferences['imapServerAddress'],
                                        $this->mailPreferences['username'],
!                                       $this->sessionData['mailbox']);
  
                        reset($_messageUID);
***************
*** 120,124 ****
                                $msglist .= $value;
                        }
!                       
                        $prefs  = $this->bopreferences->getPreferences();
  
--- 143,147 ----
                                $msglist .= $value;
                        }
! 
                        $prefs  = $this->bopreferences->getPreferences();
  
***************
*** 126,130 ****
                        $trashFolder    = $prefs['trash_folder'];
  
!                       if($this->foldername == $trashFolder && $deleteOptions 
== "move_to_trash")
                        {
                                $deleteOptions = "remove_immediately";
--- 149,153 ----
                        $trashFolder    = $prefs['trash_folder'];
  
!                       if($this->sessionData['mailbox'] == $trashFolder && 
$deleteOptions == "move_to_trash")
                        {
                                $deleteOptions = "remove_immediately";
***************
*** 176,180 ****
                                $msglist .= $value;
                        }
!                       
                        switch($_flag)
                        {
--- 199,203 ----
                                $msglist .= $value;
                        }
! 
                        switch($_flag)
                        {
***************
*** 185,188 ****
--- 208,214 ----
                                        $result = imap_setflag_full 
($this->mbox, $msglist, "\\Seen", ST_UID);
                                        break;
+                               case "answered":
+                                       $result = imap_setflag_full 
($this->mbox, $msglist, "\\Answered", ST_UID);
+                                       break;
                                case "unflagged":
                                        $result = imap_clearflag_full 
($this->mbox, $msglist, "\\Flagged", ST_UID);
***************
*** 190,193 ****
--- 216,220 ----
                                case "unread":
                                        $result = imap_clearflag_full 
($this->mbox, $msglist, "\\Seen", ST_UID);
+                                       $result = imap_clearflag_full 
($this->mbox, $msglist, "\\Answered", ST_UID);
                                        break;
                        }
***************
*** 199,211 ****
                // this function is based on a on "Building A PHP-Based Mail 
Client"
                // http://www.devshed.com
                // iterate through object returned by parse()
                // create a new array holding information only on message 
attachments
                function get_attachments($arr)
                {
!                       for($x=0; $x<sizeof($arr); $x++)
                        {
!                               if($arr[$x]["disposition"] == "attachment")
                                {
!                                       $ret[] = $arr[$x];
                                }
                        }
--- 226,291 ----
                // this function is based on a on "Building A PHP-Based Mail 
Client"
                // http://www.devshed.com
+               // fetch a specific attachment from a message
+               function getAttachment($_uid, $_partID)
+               {
+                       // parse message structure
+                       $structure = imap_fetchstructure($this->mbox, $_uid, 
FT_UID);
+                       $this->structure = array();
+                       $this->parse2($structure);
+                       $sections = $this->structure;
+                       
+                       // look for specified part
+                       while(list($key,$value) = each($sections))
+                       {
+                               #print $value["pid"]." ".$_partID."<br>";
+                               if($value["pid"] == $_partID)
+                               {
+                                       $type = $value["type"];
+                                       $encoding = $value["encoding"];
+                                       $filename = $value["name"];
+                               }
+                       }
+                       
+                       $attachment = imap_fetchbody($this->mbox, $_uid, 
$_partID, FT_UID);
+                       
+                       switch ($encoding) 
+                       {
+                               case ENCBASE64:
+                                       // use imap_base64 to decode
+                                       $attachment = imap_base64($attachment);
+                                       break;
+                               case ENCQUOTEDPRINTABLE:
+                                       // use imap_qprint to decode
+                                       $attachment = imap_qprint($attachment);
+                                       break;
+                               case ENCOTHER:
+                                       // not sure if this needs decoding at 
all
+                                       break;
+                               default:
+                                       // it is either not encoded or we don't 
know about it
+                       }
+                       
+                       return array(
+                               'type'  => $type,
+                               'encoding'      => $encoding,
+                               'filename'      => $filename,
+                               'attachment'    => $attachment
+                               );
+               }
+ 
+               // this function is based on a on "Building A PHP-Based Mail 
Client"
+               // http://www.devshed.com
                // iterate through object returned by parse()
                // create a new array holding information only on message 
attachments
                function get_attachments($arr)
                {
!                       reset($arr);
!                       while(list($key,$value) = @each($arr))
                        {
!                               if(strtolower($value["disposition"])            
== "attachment" ||
!                                       strtolower($value["disposition"])       
== "inline" ||
!                                       ($value["type"] != "text/plain" && 
substr($value["type"],0,9) != "multipart"))
                                {
!                                       $ret[] = $value;
                                }
                        }
***************
*** 214,218 ****
                }
                
!               function getFolderList($_subscribedOnly)
                {
                        $mailboxString = sprintf("{%s:%s}%s",
--- 294,316 ----
                }
                
!               function getFolderStatus($_folderName)
!               {
!                       // now we have the keys as values
!                       $subscribedFolders = 
array_flip($this->getFolderList(true));
!                       #print_r($subscribedFolders);
!                       #print $subscribedFolders[$_folderName]." - 
$_folderName<br>";
!                       if(isset($subscribedFolders[$_folderName]))
!                       {
!                               $retValue['subscribed'] = true;
!                       }
!                       else
!                       {
!                               $retValue['subscribed'] = false;
!                       }
!                       
!                       return $retValue;
!               }
!               
!               function getFolderList($_subscribedOnly=false)
                {
                        $mailboxString = sprintf("{%s:%s}%s",
***************
*** 235,239 ****
                                {
                                        $folders[] = 
preg_replace("/{.*}/","",$val->name);
!                                       
                                }
                                sort($folders,SORT_STRING);
--- 333,337 ----
                                {
                                        $folders[] = 
preg_replace("/{.*}/","",$val->name);
!                                       #$folders[] = $val->name;
                                }
                                sort($folders,SORT_STRING);
***************
*** 255,259 ****
                                        
$this->mailPreferences['imapServerAddress'],
                                        $this->mailPreferences['username'],
!                                       $this->foldername);
                        $transformdate = 
CreateObject('felamimail.transformdate');
  
--- 353,358 ----
                                        
$this->mailPreferences['imapServerAddress'],
                                        $this->mailPreferences['username'],
!                                       $this->sessionData['mailbox']);
!                       $bofilter = CreateObject('felamimail.bofilter');
                        $transformdate = 
CreateObject('felamimail.transformdate');
  
***************
*** 261,265 ****
                                        
$this->mailPreferences['imapServerAddress'],
                                        $this->mailPreferences['imapPort'],
!                                       imap_utf7_encode($this->foldername));
                        $status = imap_status ($this->mbox, $mailboxString, 
SA_ALL);
                        $cachedStatus = $caching->getImapStatus();
--- 360,364 ----
                                        
$this->mailPreferences['imapServerAddress'],
                                        $this->mailPreferences['imapPort'],
!                                       
imap_utf7_encode($this->sessionData['mailbox']));
                        $status = imap_status ($this->mbox, $mailboxString, 
SA_ALL);
                        $cachedStatus = $caching->getImapStatus();
***************
*** 390,394 ****
                        }
  
!                       $displayHeaders = $caching->getHeaders($_startMessage, 
$_numberOfMessages, $_sort);
  
                        $count=0;
--- 489,497 ----
                        }
  
!                       // now lets gets the important messages
!                       $filterList = $bofilter->getFilterList();
!                       $activeFilter = $this->sessionData['activeFilter'];
!                       $filter = $filterList[$activeFilter];
!                       $displayHeaders = $caching->getHeaders($_startMessage, 
$_numberOfMessages, $_sort, $filter);
  
                        $count=0;
***************
*** 458,462 ****
                        if(is_array($retValue['header']))
                        {
!                               $retValue['info']['total']      = 
$status->messages;
                                $retValue['info']['first']      = 
$_startMessage;
                                $retValue['info']['last']       = 
$_startMessage + $count - 1 ;
--- 561,565 ----
                        if(is_array($retValue['header']))
                        {
!                               $retValue['info']['total']      = 
$caching->getMessageCounter($filter);
                                $retValue['info']['first']      = 
$_startMessage;
                                $retValue['info']['last']       = 
$_startMessage + $count - 1 ;
***************
*** 469,493 ****
                }
  
!               function getMessageBody($_replyID, $_partID='')
                {
!                       if(!empty($_partID))
                        {
!                               return trim(imap_fetchbody($this->mbox, 
$_replyID, $_partID));
                        }
                        else
                        {
!                               return trim(imap_body($this->mbox,$_replyID));
                        }
                }
  
!               function getMessageHeaders($_replyID)
                {
!                       return imap_header($this->mbox, $_replyID);
                }
  
!               function getMessageStructure($_replyID)
                {
!                       #return imap_fetchstructure($this->mbox, $_replyID, 
FT_UID);
!                       return imap_fetchstructure($this->mbox, $_replyID);
                }
  
--- 572,675 ----
                }
  
!               function getMessageAttachments($_uid)
                {
!                       $structure = imap_fetchstructure($this->mbox, $_uid, 
FT_UID);
!                       if(sizeof($structure->parts) > 0 && 
is_array($structure->parts))
!                       {
!                               $this->structure = array();
!                               $this->parse2($structure);
!                               $sections = $this->structure;
!                               #$sections = $this->parse($structure);
!                               return $this->get_attachments($sections);
!                       }
!               }
!               
!               function getMessageBody($_uid)
!               {
!                       $structure = imap_fetchstructure($this->mbox, $_uid, 
FT_UID);
!                       if(sizeof($structure->parts) > 0 && 
is_array($structure->parts))
!                       {
!                               #print 
"<pre>";print_r($structure);print"</pre>";
!                               $this->structure = array();
!                               $this->parse2($structure);
!                               $sections = $this->structure;
!                               #print 
"<hr><pre>";print_r($this->structure);print"</pre>";
!                       }
!                       
!                       if(is_array($sections))
                        {
!                               reset($sections);
!                               while(list($key,$value) = each($sections))
!                               #for($x=0; $x<sizeof($sections); $x++)
!                               {
!                                       unset($newPart);
!                                       if(($value["type"] == "text/plain" || 
!                                               $value["type"] == 
"message/rfc822") && 
!                                               
strtolower($value["disposition"]) != "attachment")
!                                       {
!                                               $newPart = 
stripslashes(trim(imap_fetchbody($this->mbox, $_uid, $value["pid"], FT_UID)));
!                                       }
!                                       
!                                       if(isset($newPart)) 
!                                       {
!                                       switch ($value['encoding']) 
!                                       {
!                                               case ENCBASE64:
!                                                       // use imap_base64 to 
decode
!                                                       $newPart = 
imap_base64($newPart);
!                                                       break;
!                                               case ENCQUOTEDPRINTABLE:
!                                                       // use imap_qprint to 
decode
!                                                       $newPart = 
imap_qprint($newPart);
!                                                       break;
!                                               case ENCOTHER:
!                                                       // not sure if this 
needs decoding at all
!                                                       break;
!                                               default:
!                                                       // it is either not 
encoded or we don't know about it
!                                       }
!                                               $bodyPart[] = $newPart;
!                                       }
!                               }
                        }
                        else
                        {
!                               $newPart = 
stripslashes(trim(imap_body($this->mbox, $_uid, FT_UID)));
!                               switch ($structure->encoding) 
!                               {
!                                       case ENCBASE64:
!                                               // use imap_base64 to decode
!                                               $newPart = 
imap_base64($newPart);
!                                               break;
!                                       case ENCQUOTEDPRINTABLE:
!                                               // use imap_qprint to decode
!                                               $newPart = 
imap_qprint($newPart);
!                                               break;
!                                       case ENCOTHER:
!                                               // not sure if this needs 
decoding at all
!                                               break;
!                                       default:
!                                               // it is either not encoded or 
we don't know about it
!                               }
!                               $bodyPart[] = $newPart;
                        }
+                       
+                       return $bodyPart;
                }
  
!               function getMessageHeader($_uid)
                {
!                       $msgno = imap_msgno($this->mbox, $_uid);
!                       return imap_header($this->mbox, $msgno);
                }
  
!               function getMessageRawHeader($_uid)
                {
!                       return imap_fetchheader($this->mbox, $_uid, FT_UID);
!               }
! 
!               function getMessageStructure($_uid)
!               {
!                       return imap_fetchstructure($this->mbox, $_uid, FT_UID);
                }
  
***************
*** 497,501 ****
                                        
$this->mailPreferences['imapServerAddress'],
                                        $this->mailPreferences['username'],
!                                       $this->foldername);
                        $deleteOptions  = 
$GLOBALS['phpgw_info']["user"]["preferences"]["felamimail"]["deleteOptions"];
  
--- 679,683 ----
                                        
$this->mailPreferences['imapServerAddress'],
                                        $this->mailPreferences['username'],
!                                       $this->sessionData['mailbox']);
                        $deleteOptions  = 
$GLOBALS['phpgw_info']["user"]["preferences"]["felamimail"]["deleteOptions"];
  
***************
*** 529,533 ****
                        
                }
!               
                // this function is based on a on "Building A PHP-Based Mail 
Client"
                // http://www.devshed.com
--- 711,753 ----
                        
                }
! 
!               function openConnection($_folderName='',$_options=0)
!               {
!                       switch($this->mailPreferences['imap_server_type'])
!                       {
!                               case "imap":
!                                       $mailboxString = sprintf("{%s:%s}%s",
!                                                       
$this->mailPreferences['imapServerAddress'],
!                                                       
$this->mailPreferences['imapPort'],
!                                                       
imap_utf7_encode($this->sessionData['mailbox']));
!                                       break;
!                                       
!                               case "imaps-encr-only":
!                                       $mailboxString = 
sprintf("{%s:%s/ssl/novalidate-cert}%s",
!                                               
$this->mailPreferences['imapServerAddress'],
!                                               
$this->mailPreferences['imapPort'],
!                                               
imap_utf7_encode($this->sessionData['mailbox']));
!                                       break;
!                                       
!                               case "imaps-encr-auth":
!                                       $mailboxString = 
sprintf("{%s:%s/ssl}%s",
!                                               
$this->mailPreferences['imapServerAddress'],
!                                               
$this->mailPreferences['imapPort'],
!                                               
imap_utf7_encode($this->sessionData['mailbox']));
!                                       break;
!                       }
! 
!                       if(!$this->mbox = @imap_open ($mailboxString, 
!                                       $this->mailPreferences['username'], 
$this->mailPreferences['key'], $_options))
!                       {
!                               return imap_last_error();
!                       }
!                       else
!                       {
!                               return True;
!                       }
!                       
!               }               
! 
                // this function is based on a on "Building A PHP-Based Mail 
Client"
                // http://www.devshed.com
***************
*** 539,543 ****
                        // split structure into parts
                        $parts = $structure->parts;
!                       
                        for($x=0; $x<sizeof($parts); $x++)
                        {
--- 759,763 ----
                        // split structure into parts
                        $parts = $structure->parts;
!                                                                               
                                
                        for($x=0; $x<sizeof($parts); $x++)
                        {
***************
*** 554,557 ****
--- 774,778 ----
                                if ($part->encoding == "") { $part->encoding = 
0; }
                                $ret[$x]["encoding"] = 
$this->encoding[$part->encoding];
+                               $ret[$x]["Encoding"] = $part->encoding;
                                
                                $ret[$x]["size"] = strtolower($part->bytes);
***************
*** 576,581 ****
                        return $ret;
                }
  
!       }
  
  ?>
--- 797,1125 ----
                        return $ret;
                }
+               
  
!               // this function is based on
!               // 
http://www.bitsense.com/PHPNotes/IMAP/imap_fetchstructure.asp/
!               function parse2($this_part,$part_no="")
!               {
!                               if ($this_part->ifdisposition && 
strtolower($this_part->disposition) == "attachment") 
!                               {
!                                       // See if it has a disposition
!                                       // The only thing I know of that this
!                                       // would be used for would be an 
attachment
!                                       // Lets check anyway
!                                       if (strtolower($this_part->disposition) 
== "attachment" ||
!                                               
strtolower($this_part->disposition) == "inline" ) 
!                                       {
!                                               
$this->structure[$part_no]['encoding']  = $this_part->encoding;
!                                               
$this->structure[$part_no]['size']      = $this_part->bytes;
!                                               
$this->structure[$part_no]['disposition']       = $this_part->disposition;
!                                               
$this->structure[$part_no]['pid']       = $part_no;
!                                               
$this->structure[$part_no]["type"]      = $mime_type."/". 
strtolower($this_part->subtype);
!                                               // If it is an attachment, then 
we let people download it
!                                               // First see if they sent a 
filename
!                                               $att_name = lang("unknown");
!                                               if($this_part->ifparameters)
!                                               {
!                                                       for ($lcv = 0; $lcv < 
count($this_part->parameters); $lcv++) 
!                                                       {
!                                                               $param = 
$this_part->parameters[$lcv];
!                                                               if 
(strtolower($param->attribute) == "name") 
!                                                               {
!                                                                       
$this->structure[$part_no]["name"] = $param->value;
!                                                                       break;
!                                                               }
!                                                       }
!                                               }
!                                               if($this_part->ifdparameters)
!                                               {
!                                                       for ($lcv = 0; $lcv < 
count($this_part->dparameters); $lcv++) 
!                                                       {
!                                                               $param = 
$this_part->dparameters[$lcv];
!                                                               if 
(strtolower($param->attribute) == "filename") 
!                                                               {
!                                                                       
$this->structure[$part_no]["name"] = $param->value;
!                                                                       break;
!                                                               }
!                                                       }
!                                               }
!                                               // You could give a link to 
download the attachment here....
!                                               switch ($this_part->type) 
!                                               {
!                                                       case TYPETEXT:
!                                                               $mime_type = 
"text";
!                                                               break;
!                                                       case TYPEMULTIPART:
!                                                               $mime_type = 
"multipart";
!                                                               break;
!                                                       case TYPEMESSAGE:
!                                                               $mime_type = 
"message";
!                                                               break;
!                                                       case TYPEAPPLICATION:
!                                                               $mime_type = 
"application";
!                                                               break;
!                                                       case TYPEAUDIO:
!                                                               $mime_type = 
"audio";
!                                                               break;
!                                                       case TYPEIMAGE:
!                                                               $mime_type = 
"image";
!                                                               break;
!                                                       case TYPEVIDEO:
!                                                               $mime_type = 
"video";
!                                                               break;
!                                                       case TYPEMODEL:
!                                                               $mime_type = 
"model";
!                                                               break;
!                                                       default:
!                                                               $mime_type = 
"unknown";
!                                                               // hmmm....
!                                               }
!                                               
$this->structure[$part_no]["type"] = $mime_type."/". 
strtolower($this_part->subtype);
!                                       } 
!                                       else 
!                                       {
!                                               // disposition can also be used 
for images in HTML (Inline)
!                                       }
!                               }
!                               else
!                               {
!                                       // Not an attachment, lets see what 
this part is...
!                                       #print "Type: ".$this_part->type."<br>";
!                                       switch ($this_part->type) 
!                                       {
!                                               case TYPETEXT:
!                                                       $mime_type = "text";
!                                                       
$this->structure[$part_no]['encoding']  = $this_part->encoding;
!                                                       
$this->structure[$part_no]['size']      = $this_part->bytes;
!                                                       
$this->structure[$part_no]['pid']       = $part_no;
!                                                       
$this->structure[$part_no]["type"]      = $mime_type."/". 
strtolower($this_part->subtype);
!                                                       
$this->structure[$part_no]["name"]      = lang("unknown");
!                                                       for ($lcv = 0; $lcv < 
count($this_part->parameters); $lcv++) 
!                                                       {
!                                                               $param = 
$this_part->parameters[$lcv];
!                                                               if 
(strtolower($param->attribute) == "name") 
!                                                               {
!                                                                       
$this->structure[$part_no]["name"] = $param->value;
!                                                                       break;
!                                                               }
!                                                       }
!                                                       break;
!                                               
!                                               case TYPEMULTIPART:
!                                                       $mime_type = 
"multipart";
!                                                       #print "found 
$mime_type<br>";
!                                                       // Hey, why not use 
this function to deal with all the parts
!                                                       // of this multipart 
part :)
!                                                       for ($i = 0; $i < 
count($this_part->parts); $i++) 
!                                                       {
!                                                               if ($part_no != 
"") 
!                                                               {
!                                                                       
$part_no = $part_no.".";
!                                                               }
!                                                               
$this->structure[$part_no.($i + 1)]['encoding'] = $this_part->encoding;
!                                                               
$this->structure[$part_no.($i + 1)]['size']     = $this_part->bytes;
!                                                               
$this->structure[$part_no.($i + 1)]['pid']      = $part_no.($i + 1);
!                                                               
$this->structure[$part_no.($i + 1)]["type"]     = $mime_type."/". 
strtolower($this_part->subtype);
!                                                               for ($i = 0; $i 
< count($this_part->parts); $i++) 
!                                                               {
!                                                                       
$this->parse2($this_part->parts[$i], $part_no.($i + 1));
!                                                               }
!                                                       }
!                                                       break;
!                                               case TYPEMESSAGE:
!                                                       $mime_type = "message";
!                                                       
$this->structure[$part_no]['encoding']  = $this_part->encoding;
!                                                       
$this->structure[$part_no]['size']      = $this_part->bytes;
!                                                       
$this->structure[$part_no]['pid']       = $part_no;
!                                                       
$this->structure[$part_no]["type"]      = $mime_type."/". 
strtolower($this_part->subtype);
!                                                       $att_name = "unknown";
!                                                       for ($lcv = 0; $lcv < 
count($this_part->parameters); $lcv++) 
!                                                       {
!                                                               $param = 
$this_part->parameters[$lcv];
!                                                               if 
($param->attribute == "NAME" ||
!                                                                       
$param->attribute == "name") 
!                                                               {
!                                                                       
$this->structure[$part_no]["name"] = $param->value;
!                                                                       break;
!                                                               }
!                                                       }
!                                                       break;
!                                               case TYPEAPPLICATION:
!                                                       $mime_type = 
"application";
!                                                       
$this->structure[$part_no]['encoding']  = $this_part->encoding;
!                                                       
$this->structure[$part_no]['size']      = $this_part->bytes;
!                                                       
$this->structure[$part_no]['pid']       = $part_no;
!                                                       
$this->structure[$part_no]["type"]      = $mime_type."/". 
strtolower($this_part->subtype);
!                                                       $att_name = "unknown";
!                                                       for ($lcv = 0; $lcv < 
count($this_part->parameters); $lcv++) 
!                                                       {
!                                                               $param = 
$this_part->parameters[$lcv];
!                                                               if 
($param->attribute == "NAME" ||
!                                                                       
$param->attribute == "name") 
!                                                               {
!                                                                       
$this->structure[$part_no]["name"] = $param->value;
!                                                                       break;
!                                                               }
!                                                       }
!                                                       break;
!                                               case TYPEAUDIO:
!                                                       $mime_type = "audio";
!                                                       
$this->structure[$part_no]['encoding']  = $this_part->encoding;
!                                                       
$this->structure[$part_no]['size']      = $this_part->bytes;
!                                                       
$this->structure[$part_no]['pid']       = $part_no;
!                                                       
$this->structure[$part_no]["type"]      = $mime_type."/". 
strtolower($this_part->subtype);
!                                                       $att_name = "unknown";
!                                                       for ($lcv = 0; $lcv < 
count($this_part->parameters); $lcv++) 
!                                                       {
!                                                               $param = 
$this_part->parameters[$lcv];
!                                                               if 
($param->attribute == "NAME" ||
!                                                                       
$param->attribute == "name") 
!                                                               {
!                                                                       
$this->structure[$part_no]["name"] = $param->value;
!                                                                       break;
!                                                               }
!                                                       }
!                                                       break;
!                                               case TYPEIMAGE:
!                                                       $mime_type = "image";
!                                                       
$this->structure[$part_no]['encoding']  = $this_part->encoding;
!                                                       
$this->structure[$part_no]['size']      = $this_part->bytes;
!                                                       
$this->structure[$part_no]['pid']       = $part_no;
!                                                       
$this->structure[$part_no]["type"]      = $mime_type."/". 
strtolower($this_part->subtype);
!                                                       $att_name = "unknown";
!                                                       for ($lcv = 0; $lcv < 
count($this_part->parameters); $lcv++) 
!                                                       {
!                                                               $param = 
$this_part->parameters[$lcv];
!                                                               if 
($param->attribute == "NAME" ||
!                                                                       
$param->attribute == "name") 
!                                                               {
!                                                                       
$this->structure[$part_no]["name"] = $param->value;
!                                                                       break;
!                                                               }
!                                                       }
!                                                       break;
!                                               case TYPEVIDEO:
!                                                       $mime_type = "video";
!                                                       
$this->structure[$part_no]['encoding']  = $this_part->encoding;
!                                                       
$this->structure[$part_no]['size']      = $this_part->bytes;
!                                                       
$this->structure[$part_no]['pid']       = $part_no;
!                                                       
$this->structure[$part_no]["type"]      = $mime_type."/". 
strtolower($this_part->subtype);
!                                                       $att_name = "unknown";
!                                                       for ($lcv = 0; $lcv < 
count($this_part->parameters); $lcv++) 
!                                                       {
!                                                               $param = 
$this_part->parameters[$lcv];
!                                                               if 
($param->attribute == "NAME" ||
!                                                                       
$param->attribute == "name") 
!                                                               {
!                                                                       
$this->structure[$part_no]["name"] = $param->value;
!                                                                       break;
!                                                               }
!                                                       }
!                                                       break;
!                                               case TYPEMODEL:
!                                                       $mime_type = "model";
!                                                       break;
!                                               default:
!                                                       $mime_type = "unknown";
!                                                       // hmmm....
!                                       }
!                                       $full_mime_type = 
$mime_type."/".$this_part->subtype;
!                                       
!                                       // Decide what you what to do with this 
part
!                                       // If you want to show it, figure out 
the encoding and echo away
!                                       switch ($this_part->encoding) 
!                                       {
!                                               case ENCBASE64:
!                                                       // use imap_base64 to 
decode
!                                                       break;
!                                               case ENCQUOTEDPRINTABLE:
!                                                       // use imap_qprint to 
decode
!                                                       break;
!                                               case ENCOTHER:
!                                                       // not sure if this 
needs decoding at all
!                                                       break;
!                                               default:
!                                                       // it is either not 
encoded or we don't know about it
!                                       }
!                               }
!               }
!               
!               function restoreSessionData()
!               {
!                       $this->sessionData = 
$GLOBALS['phpgw']->session->appsession('session_data');
!               }
!               
!               function saveFilter($_formData)
!               {
!                       if(!empty($_formData['from']))
!                               $data['from']   = $_formData['from'];
!                       if(!empty($_formData['to']))
!                               $data['to']     = $_formData['to'];
!                       if(!empty($_formData['subject']))
!                               $data['subject']= $_formData['subject'];
!                       if($_formData['filterActive'] == "true")
!                       {
!                               $data['filterActive']= "true";
!                       }
  
+                       $this->sessionData['filter'] = $data;
+                       $this->saveSessionData();
+               }
+               
+               function saveSessionData()
+               {
+                       
$GLOBALS['phpgw']->session->appsession('session_data','',$this->sessionData);
+               }
+               
+               function subscribe($_folderName, $_status)
+               {
+                       #$this->mailPreferences['imapServerAddress']
+                       #$this->mailPreferences['imapPort'],
+                       
+                       $folderName = imap_utf7_encode($_folderName);
+                       $folderName = 
"{".$this->mailPreferences['imapServerAddress'].":".$this->mailPreferences['imapPort']."}".$folderName;
+                       
+                       if($_status == 'unsubscribe')
+                       {
+                               return 
imap_unsubscribe($this->mbox,$folderName);
+                       }
+                       else
+                       {
+                               return imap_subscribe($this->mbox,$folderName);
+                       }
+               }
+               
+               function toggleFilter()
+               {
+                       if($this->sessionData['filter']['filterActive'] == 
'true')
+                       {
+                               $this->sessionData['filter']['filterActive'] = 
'false';
+                       }
+                       else
+                       {
+                               $this->sessionData['filter']['filterActive'] = 
'true';
+                       }
+                       $this->saveSessionData();
+               }
+               
+               function validate_email($_emailAddress)
+               {
+                       if($val != "")
+                       {
+                               $pattern = 
"/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/";
+                               if(preg_match($pattern, $val))
+                               {
+                                       return true;
+                               }
+                               else
+                               {
+                                       return false;
+                               }
+                       }
+                       else
+                       {
+                               return false;
+                       }
+               }
+       }
  ?>

Index: class.bopreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.bopreferences.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.bopreferences.inc.php 26 Apr 2002 15:51:35 -0000      1.4
--- class.bopreferences.inc.php 24 Nov 2002 00:32:13 -0000      1.5
***************
*** 19,33 ****
                (
                        'getPreferences'        => True,
!                       'none'                          => True
                );
! 
                function bopreferences()
                {
                        #$this->bocompose       = 
CreateObject('felamimail.bocompose');
                }
! 
                function getPreferences()
                {
! /*                    while(list($key,$value) = 
each($GLOBALS['phpgw_info']['user']['preferences']) )
                        {
                                print ". $key: $value<br>";
--- 19,33 ----
                (
                        'getPreferences'        => True,
!                       'none'  => True
                );
!               
                function bopreferences()
                {
                        #$this->bocompose       = 
CreateObject('felamimail.bocompose');
                }
!               
                function getPreferences()
                {
! /*                    while(list($key,$value) = 
each($GLOBALS['phpgw_info']['server']) )
                        {
                                print ". $key: $value<br>";
***************
*** 40,86 ****
                                }
                        }
! */
!                       if 
($GLOBALS['phpgw_info']['user']['preferences']['email']['use_custom_settings'] 
== 'True')
!                       {
!                               $data['imapServerAddress']      = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['mail_server'];
  
!                               $data['key']                            = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['passwd'];
!                               $data['username']                       = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['userid'];
!                               $data['emailAddress']           = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['address'];
  
!                               $data['imap_server_type']       = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['email']['imap_server_type']);
!                       }
!                       else
                        {
!                               $data['imapServerAddress']      = 
$GLOBALS['phpgw_info']['server']['mail_server'];
  
-                               $data['key']                            = 
$GLOBALS['phpgw_info']['user']['passwd'];
-                               $data['username']                       = 
$GLOBALS['phpgw_info']['user']['userid'];
-                               $data['emailAddress']           = 
$GLOBALS['phpgw_info']['user']['userid']."@".$GLOBALS['phpgw_info']['server']['mail_suffix'];
  
!                               $data['imap_server_type']       = 
strtolower($GLOBALS['phpgw_info']["server"]["address"]);
                        }
  
!                       // global settings
!                       $data['realname']                       = 
$GLOBALS['phpgw_info']['user']['fullname'];
!                       $data['defaultDomainname']      = 
$GLOBALS['phpgw_info']["server"]["mail_suffix"];
  
!                       $data['smtpServerAddress']      = 
$GLOBALS['phpgw_info']["server"]["smtp_server"];
!                       $data['smtpPort']                       = 
$GLOBALS['phpgw_info']["server"]["smtp_port"];
  
!                       $data['imapPort']                       = 143;
  
                        // preferences
                        $data['deleteOptions']          = 
$GLOBALS['phpgw_info']['user']['preferences']['felamimail']['deleteOptions'];
                        if(empty($data['deleteOptions']))
                        {
!                               $data['deleteOptions']  = 'remove_immediately';
                        }
! 
                        $data['trash_folder']           = 
$GLOBALS['phpgw_info']['user']['preferences']['felamimail']['trashFolder'];
- 
                        if(empty($data['trash_folder']))
                        {
!                               $data['trash_folder']   = 'INBOX.Trash';
                        }
  
--- 40,147 ----
                                }
                        }
! */                    
  
!                       $config = CreateObject('phpgwapi.config','felamimail');
!                       $config->read_repository();
!                       $felamimailConfig = $config->config_data;
!                       unset($config);
!                       
!                       #_debug_array($felamimailConfig);
!                       #print "<hr>";
!                       
!                       // set values to the global values
!                       $data['imapServerAddress']      = 
$GLOBALS['phpgw_info']['server']['mail_server'];
!                       $data['key']                    = 
$GLOBALS['phpgw_info']['user']['passwd'];
!                       $data['username']               = 
$GLOBALS['phpgw_info']['user']['userid'];
!                       $data['imap_server_type']       = 
strtolower($felamimailConfig["imapServerMode"]);
!                       $data['realname']               = 
$GLOBALS['phpgw_info']['user']['fullname'];
!                       $data['defaultDomainname']      = 
$GLOBALS['phpgw_info']["server"]["mail_suffix"];
  
!                       $data['smtpServerAddress']      = 
$GLOBALS['phpgw_info']["server"]["smtp_server"];
!                       $data['smtpPort']               = 
$GLOBALS['phpgw_info']["server"]["smtp_port"];
! 
!                       switch($data['imap_server_type'])
                        {
!                               case "imaps-encr-only":
!                               case "imaps-encr-auth":
!                                       $data['imapPort']       = 993;
!                                       break;
!                               default:
!                                       $data['imapPort']       = 143;
!                                       break;
!                       }
!                       
!                       // check for felamimail specific settings
!                       if(!empty($felamimailConfig['imapServer']))
!                               $data['imapServerAddress']      = 
$felamimailConfig['imapServer'];
! 
!                       if(!empty($felamimailConfig['smtpServer']))
!                               $data['smtpServerAddress']      = 
$felamimailConfig['smtpServer'];
!                       
!                       if(!empty($felamimailConfig['smtpServer']))
!                               $data['smtpPort']               = 
$felamimailConfig['smtpPort'];
! 
!                       if(!empty($felamimailConfig['mailSuffix']))
!                               $data['defaultDomainname']      = 
$felamimailConfig['mailSuffix'];
! 
!                       $data['emailAddress']           = 
$data['username']."@".$data['defaultDomainname'];
! 
!                       
if($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap')
!                       {
!                               // do a ldap lookup to fetch users email address
!                               $ldap = 
$GLOBALS['phpgw']->common->ldapConnect();
!                               $filter = 
sprintf("(&(uid=%s)(objectclass=posixAccount))",$GLOBALS['phpgw_info']['user']['userid']);
!                               
!                               $sri = 
@ldap_search($ldap,$GLOBALS['phpgw_info']['server']['ldap_context'],$filter);
!                               if ($sri)
!                               {
!                                       $allValues = ldap_get_entries($ldap, 
$sri);
  
  
!                                       
if(isset($allValues[0]['emailaddress'][0]))
!                                       {
!                                               $data['emailAddress']           
= $allValues[0]['emailaddress'][0];
!                                       }
!                                       
elseif(isset($allValues[0]['maillocaladdress'][0]))
!                                       {
!                                               $data['emailAddress']           
= $allValues[0]['maillocaladdress'][0];
!                                       }
!                                       elseif(isset($allValues[0]['mail'][0]))
!                                       {
!                                               $data['emailAddress']           
= $allValues[0]['mail'][0];
!                                       }
!                               }
                        }
+                       
+                       // check for user specific settings
+                       if 
($GLOBALS['phpgw_info']['user']['preferences']['email']['use_custom_settings'] 
== 'True')
+                       {
+                               
if(!empty($GLOBALS['phpgw_info']['user']['preferences']['email']['userid']))
+                                       $data['username']               = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['userid'];
  
!                               
if(!empty($GLOBALS['phpgw_info']['user']['preferences']['email']['passwd']))
!                                       $data['key']                    = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['passwd'];
  
!                               
if(!empty($GLOBALS['phpgw_info']['user']['preferences']['email']['address']))
!                                       $data['emailAddress']           = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['address'];
  
!                               
if(!empty($GLOBALS['phpgw_info']['user']['preferences']['email']['mail_server']))
!                                       $data['imapServerAddress']      = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['mail_server'];
  
+                               
if(!empty($GLOBALS['phpgw_info']['user']['preferences']['email']['imap_server_type']))
+                                       $data['imap_server_type']       = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['email']['mail_server_type']);
+                       }
+                       
                        // preferences
                        $data['deleteOptions']          = 
$GLOBALS['phpgw_info']['user']['preferences']['felamimail']['deleteOptions'];
                        if(empty($data['deleteOptions']))
                        {
!                               $data['deleteOptions'] = 'remove_immediately';
                        }
!                       
                        $data['trash_folder']           = 
$GLOBALS['phpgw_info']['user']['preferences']['felamimail']['trashFolder'];
                        if(empty($data['trash_folder']))
                        {
!                               $data['trash_folder'] = 'INBOX.Trash';
                        }
  
***************
*** 89,109 ****
                        if (empty($data['sent_folder']))
                        {
!                               $data['sent_folder']    = 'INBOX.Sent'; 
                        }
  
!                       if (!empty($data['trash_folder']))
!                       { 
                                $data['move_to_trash']  = True;
-                       }
- 
                        if (!empty($data['sent_folder'])) 
-                       {
                                $data['move_to_sent']   = True;
!                       }
! 
!                       $data['signature']                      = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['email_sig'];
  
                //      _debug_array($data);
                        return $data;
                }
!       }
--- 150,164 ----
                        if (empty($data['sent_folder']))
                        {
!                               $data['sent_folder'] = 'INBOX.Sent'; 
                        }
  
!                       if (!empty($data['trash_folder'])) 
                                $data['move_to_trash']  = True;
                        if (!empty($data['sent_folder'])) 
                                $data['move_to_sent']   = True;
!                       $data['signature']              = 
$GLOBALS['phpgw_info']['user']['preferences']['felamimail']['email_sig'];
  
                //      _debug_array($data);
                        return $data;
                }
! }
\ No newline at end of file

Index: class.phpmailer.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.phpmailer.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.phpmailer.inc.php     31 Dec 2001 00:59:04 -0000      1.1.1.1
--- class.phpmailer.inc.php     24 Nov 2002 00:32:13 -0000      1.2
***************
*** 3,7 ****
  // phpmailer - PHP email class
  //
! // Version 1.50, Created 11/08/2001
  //
  // Class for sending email using either
--- 3,7 ----
  // phpmailer - PHP email class
  //
! // Version 1.62, Created 06/26/2002
  //
[...2074 lines suppressed...]
!         $mime[] = sprintf("Content-Type: %s; charset = \"%s\"%s", 
!                           $this->ContentType, $this->CharSet, $this->LE);
!         //$mime[] = sprintf("Content-Transfer-Encoding: %s%s", 
$this->Encoding, 
!         //                  $this->LE);
!         
!         if(strlen($this->Disposition) > 0)
!         {
!             $mime[] = sprintf("Content-Disposition: %s;");
!             if(strlen($this->FileName) > 0)
!                 $mime[] = sprinf("filename=\"%s\"", $this->$this->FileName);
!         }
!         
!         if($bLineEnding)
!             $mime[] = $this->LE;
! 
!         return join("", $mime);
!     }
! }
! 
  ?>

Index: class.smtp.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.smtp.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.smtp.php      31 Dec 2001 00:59:04 -0000      1.1.1.1
--- class.smtp.php      24 Nov 2002 00:32:13 -0000      1.2
***************
*** 1,1005 ****
! <?php
!     /*
!      * File: smtp.php
!      *
!      * Description: Define an SMTP class that can be used to connect
!      *              and communicate with any SMTP server. It implements
!      *              all the SMTP functions defined in RFC821 except TURN.
!      *
!      * Creator: Chris Ryan <address@hidden>
!      * Created: 03/26/2001
[...1984 lines suppressed...]
!                     echo "SMTP -> get_lines(): \$data was \"$data\"" .
!                              $this->CRLF;
!                     echo "SMTP -> get_lines(): \$str is \"$str\"" .
!                              $this->CRLF;
!                 }
!                 $data .= $str;
!                 if($this->do_debug >= 4) {
!                     echo "SMTP -> get_lines(): \$data is \"$data\"" . 
$this->CRLF;
!                 }
!                 # if the 4th character is a space then we are done reading
!                 # so just break the loop
!                 if(substr($str,3,1) == " ") { break; }
!             }
!             return $data;
!         }
! 
!     }
! 
! 
!  ?>

Index: class.socaching.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.socaching.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.socaching.inc.php     27 Mar 2002 22:06:44 -0000      1.3
--- class.socaching.inc.php     24 Nov 2002 00:32:13 -0000      1.4
***************
*** 48,52 ****
                }
                
!               function getHeaders($_firstMessage='', $_numberOfMessages='', 
$_sort='')
                {
                        switch($_sort)
--- 48,52 ----
                }
                
!               function getHeaders($_firstMessage='', $_numberOfMessages='', 
$_sort='', $_filter='')
                {
                        switch($_sort)
***************
*** 74,81 ****
                        }
                        
                        $query = sprintf("select uid, date, subject, 
sender_name, sender_address, to_name, to_address, size, attachments from 
phpgw_felamimail_cache ".
!                                        "where accountid='%s' and 
hostname='%s' and foldername = '%s' and accountname='%s' $sort",
                                         $this->accountid, 
addslashes($this->hostname),
!                                        addslashes($this->foldername), 
addslashes($this->accountname));
                        #print "$query<br>";
                        
--- 74,98 ----
                        }
                        
+                       while(list($key,$value) = @each($_filter))
+                       {
+                               switch($key)
+                               {
+                                       case "from":
+                                               $filter .= " and (sender_name 
like '%$value%' or sender_address like '%$value%') ";
+                                               break;
+                                       case "to":
+                                               $filter .= " and (to_name like 
'%$value%' or to_address like '%$value%') ";
+                                               break;
+                                       case "subject":
+                                               $filter .= " and subject like 
'%$value%' ";
+                                               break;
+                               }
+                       }
+                       
                        $query = sprintf("select uid, date, subject, 
sender_name, sender_address, to_name, to_address, size, attachments from 
phpgw_felamimail_cache ".
!                                        "where accountid='%s' and 
hostname='%s' and foldername = '%s' and accountname='%s' %s $sort",
                                         $this->accountid, 
addslashes($this->hostname),
!                                        addslashes($this->foldername), 
addslashes($this->accountname),
!                                        $filter);
                        #print "$query<br>";
                        
***************
*** 138,141 ****
--- 155,192 ----
                }
                
+               // return the numbers of messages in cache currently
+               // but use the use filter
+               function getMessageCounter($_filter)
+               {
+                       while(list($key,$value) = @each($_filter))
+                       {
+                               switch($key)
+                               {
+                                       case "from":
+                                               $filter .= " and (sender_name 
like '%$value%' or sender_address like '%$value%') ";
+                                               break;
+                                       case "to":
+                                               $filter .= " and (to_name like 
'%$value%' or to_address like '%$value%') ";
+                                               break;
+                                       case "subject":
+                                               $filter .= " and subject like 
'%$value%' ";
+                                               break;
+                               }
+                       }
+                       
+                       $query = sprintf("select count(*) as count from 
phpgw_felamimail_cache ".
+                                        "where accountid='%s' and 
hostname='%s' and foldername = '%s' and accountname='%s' %s",
+                                        $this->accountid, 
addslashes($this->hostname),
+                                        addslashes($this->foldername), 
addslashes($this->accountname),
+                                        $filter);
+                       #print "$query<br>";
+                       
+                       $this->db->query("$query",__LINE__,__FILE__);
+                       
+                       $this->db->next_record();
+                       
+                       return $this->db->f("count");
+               }
+               
                function removeFromCache($_uid)
                {
***************
*** 153,175 ****
                function updateImapStatus($_status, $firstUpdate)
                {
!                       if ($firstUpdate == true)
!                       {
!                               $query = sprintf("insert into 
phpgw_felamimail_folderstatus ".
!                                        
"(accountid,hostname,foldername,accountname,messages,recent,unseen,uidnext,uidvalidity)
 ".
!                                        
"values('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
!                                        $this->accountid, 
addslashes($this->hostname),
!                                        addslashes($this->foldername), 
addslashes($this->accountname),
!                                        $_status->messages, $_status->recent, 
$_status->unseen, $_status->uidnext,
!                                        $_status->uidvalidity);
!                       }
!                       else
!                       {
!                               $query = sprintf("update 
phpgw_felamimail_folderstatus ".
!                                        "set messages='%s', recent='%s', 
unseen='%s', uidnext='%s', uidvalidity='%s' ".
!                                        "where accountid='%s' and 
hostname='%s' and foldername = '%s' and accountname='%s'",
!                                        $_status->messages, $_status->recent, 
$_status->unseen, $_status->uidnext,
!                                        $_status->uidvalidity, 
$this->accountid, addslashes($this->hostname),
!                                        addslashes($this->foldername), 
addslashes($this->accountname));
!                       }
                        $this->db->query($query);
                }
--- 204,220 ----
                function updateImapStatus($_status, $firstUpdate)
                {
!                       $query = sprintf("delete from 
phpgw_felamimail_folderstatus where ".
!                                "accountid='%s' and hostname='%s' and 
foldername='%s' and accountname='%s'",
!                                $this->accountid, addslashes($this->hostname),
!                                addslashes($this->foldername), 
addslashes($this->accountname));
!                       $this->db->query($query);
! 
!                       $query = sprintf("insert into 
phpgw_felamimail_folderstatus ".
!                                
"(accountid,hostname,foldername,accountname,messages,recent,unseen,uidnext,uidvalidity)
 ".
!                                
"values('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
!                                $this->accountid, addslashes($this->hostname),
!                                addslashes($this->foldername), 
addslashes($this->accountname),
!                                $_status->messages, $_status->recent, 
$_status->unseen, $_status->uidnext,
!                                $_status->uidvalidity);
                        $this->db->query($query);
                }

Index: class.sofelamimail.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.sofelamimail.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: class.transformdate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.transformdate.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: class.uicompose.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.uicompose.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.uicompose.inc.php     27 Mar 2002 22:06:44 -0000      1.3
--- class.uicompose.inc.php     24 Nov 2002 00:32:13 -0000      1.4
***************
*** 44,48 ****
                        }                       
                        
!                       $this->t = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
  
                        $this->t->set_unknowns('remove');
--- 44,49 ----
                        }                       
                        
!                       $this->t                = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
!                       $this->bofelamimail     = 
CreateObject('felamimail.bofelamimail');
  
                        $this->t->set_unknowns('remove');
***************
*** 54,57 ****
--- 55,65 ----
                }
                
+               function unhtmlentities ($string)
+               {
+                       $trans_tbl = get_html_translation_table (HTML_ENTITIES);
+                       $trans_tbl = array_flip ($trans_tbl);
+                       return strtr ($string, $trans_tbl);
+               }
+ 
                function action()
                {
***************
*** 64,67 ****
--- 72,76 ----
                        $formData['priority']   = 
$this->bocompose->stripSlashes($GLOBALS['HTTP_POST_VARS']['priority']);
                        $formData['signature']  = 
$this->bocompose->stripSlashes($GLOBALS['HTTP_POST_VARS']['signature']);
+                       $formData['mailbox']    = 
$GLOBALS['HTTP_GET_VARS']['mailbox'];
  
                        if (isset($GLOBALS['HTTP_POST_VARS']['send'])) 
***************
*** 136,143 ****
                        $linkData = array
                        (
!                               'mailbox'       => 
urlencode($GLOBALS['HTTP_GET_VARS']['mailbox']),
!                               'startMessage'  => 
$GLOBALS['HTTP_GET_VARS']['startMessage'],
!                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
!                               'sort'          => 
$GLOBALS['HTTP_GET_VARS']['sort']
                        );
                        
$this->t->set_var("link_message_list",$GLOBALS['phpgw']->link('/felamimail/index.php',$linkData));
--- 145,149 ----
                        $linkData = array
                        (
!                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen'
                        );
                        
$this->t->set_var("link_message_list",$GLOBALS['phpgw']->link('/felamimail/index.php',$linkData));
***************
*** 146,162 ****
                        (
                                'menuaction'    => 
'felamimail.uicompose.action',
!                               'composeid'     => $this->composeID,
!                               'mailbox'       => 
urlencode($GLOBALS['HTTP_GET_VARS']['mailbox']),
!                               'startMessage'  => '1'
                        );
                        
$this->t->set_var("link_action",$GLOBALS['phpgw']->link('/index.php',$linkData));
!                       
$this->t->set_var('folder_name',$GLOBALS['HTTP_GET_VARS']['mailbox']);
  
                        // header
!                       $this->t->set_var("to",$sessionData['to']);
!                       $this->t->set_var("cc",$sessionData['cc']);
!                       $this->t->set_var("bcc",$sessionData['bcc']);
!                       $this->t->set_var("reply_to",$sessionData['reply_to']);
!                       $this->t->set_var("subject",$sessionData['subject']);
                        $this->t->pparse("out","header");
  
--- 152,167 ----
                        (
                                'menuaction'    => 
'felamimail.uicompose.action',
!                               'composeid'     => $this->composeID
                        );
                        
$this->t->set_var("link_action",$GLOBALS['phpgw']->link('/index.php',$linkData));
!                       
$this->t->set_var('folder_name',$this->bofelamimail->sessionData['mailbox']);
  
                        // header
!                       
$this->t->set_var("from",htmlentities($this->bocompose->getUserName(),ENT_QUOTES));
!                       
$this->t->set_var("to",htmlentities($sessionData['to'],ENT_QUOTES));
!                       
$this->t->set_var("cc",htmlentities($sessionData['cc'],ENT_QUOTES));
!                       
$this->t->set_var("bcc",htmlentities($sessionData['bcc'],ENT_QUOTES));
!                       
$this->t->set_var("reply_to",htmlentities($sessionData['reply_to'],ENT_QUOTES));
!                       
$this->t->set_var("subject",htmlentities($sessionData['subject'],ENT_QUOTES));
                        $this->t->pparse("out","header");
  
***************
*** 202,210 ****
                {
                        $replyID = $GLOBALS['HTTP_GET_VARS']['reply_id'];
!                       $folder  = 
urldecode($GLOBALS['HTTP_GET_VARS']['mailbox']);
!                       if (!empty($replyID) && !empty($folder))
                        {
                                // this fill the session data with the values 
from the original email
!                               $this->bocompose->getForwardData($folder, 
$replyID);
                        }
                        $this->compose();
--- 207,214 ----
                {
                        $replyID = $GLOBALS['HTTP_GET_VARS']['reply_id'];
!                       if (!empty($replyID))
                        {
                                // this fill the session data with the values 
from the original email
!                               $this->bocompose->getForwardData($replyID);
                        }
                        $this->compose();
***************
*** 214,222 ****
                {
                        $replyID = $GLOBALS['HTTP_GET_VARS']['reply_id'];
!                       $folder  = 
urldecode($GLOBALS['HTTP_GET_VARS']['mailbox']);
!                       if (!empty($replyID) && !empty($folder))
                        {
                                // this fill the session data with the values 
from the original email
!                               $this->bocompose->getReplyData($folder, 
$replyID);
                        }
                        $this->compose();
--- 218,225 ----
                {
                        $replyID = $GLOBALS['HTTP_GET_VARS']['reply_id'];
!                       if (!empty($replyID))
                        {
                                // this fill the session data with the values 
from the original email
!                               $this->bocompose->getReplyData('single', 
$replyID);
                        }
                        $this->compose();
***************
*** 226,234 ****
                {
                        $replyID = $GLOBALS['HTTP_GET_VARS']['reply_id'];
!                       $folder  = 
urldecode($GLOBALS['HTTP_GET_VARS']['mailbox']);
!                       if (!empty($replyID) && !empty($folder))
                        {
                                // this fill the session data with the values 
from the original email
!                               $this->bocompose->getReplyData($folder, 
$replyID);
                        }
                        $this->compose();
--- 229,236 ----
                {
                        $replyID = $GLOBALS['HTTP_GET_VARS']['reply_id'];
!                       if (!empty($replyID))
                        {
                                // this fill the session data with the values 
from the original email
!                               $this->bocompose->getReplyData('all', $replyID);
                        }
                        $this->compose();
***************
*** 241,244 ****
--- 243,247 ----
                        $this->t->set_var("lang_cc",lang('cc'));
                        $this->t->set_var("lang_bcc",lang('bcc'));
+                       $this->t->set_var("lang_from",lang('from'));
                        $this->t->set_var("lang_reply_to",lang('reply to'));
                        $this->t->set_var("lang_subject",lang('subject'));
***************
*** 261,263 ****
                        
$this->t->set_var("bg03",$GLOBALS['phpgw_info']["theme"]["bg03"]);
                }
! }
\ No newline at end of file
--- 264,268 ----
                        
$this->t->set_var("bg03",$GLOBALS['phpgw_info']["theme"]["bg03"]);
                }
! }
! 
! ?>

Index: class.uifelamimail.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.uifelamimail.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.uifelamimail.inc.php  26 Apr 2002 15:51:35 -0000      1.5
--- class.uifelamimail.inc.php  24 Nov 2002 00:32:13 -0000      1.6
***************
*** 18,24 ****
                var $public_functions = array
                (
!                       'viewMainScreen'        => True,
!                       'handleButtons'         => True,
                        'deleteMessage'         => True,
                        'compressFolder'        => True
                );
--- 18,26 ----
                var $public_functions = array
                (
!                       'addVcard'              => True,
                        'deleteMessage'         => True,
+                       'handleButtons'         => True,
+                       'toggleFilter'          => True,
+                       'viewMainScreen'        => True,
                        'compressFolder'        => True
                );
***************
*** 43,68 ****
                        if(isset($GLOBALS['HTTP_POST_VARS']["mark_deleted_x"])) 
                                $GLOBALS['HTTP_POST_VARS']["mark_deleted"] = 
"true";
                        
!                       if(isset($GLOBALS['HTTP_POST_VARS']["mailbox"]) && 
                                $GLOBALS['HTTP_GET_VARS']["menuaction"] == 
"felamimail.uifelamimail.handleButtons" &&
!                               
!isset($GLOBALS['HTTP_POST_VARS']["mark_unread"]) &&
!                               !isset($GLOBALS['HTTP_POST_VARS']["mark_read"]) 
&&
!                               
!isset($GLOBALS['HTTP_POST_VARS']["mark_unflagged"]) &&
!                               
!isset($GLOBALS['HTTP_POST_VARS']["mark_flagged"]) &&
!                               
!isset($GLOBALS['HTTP_POST_VARS']["mark_deleted"]))
                        {
                                if ($GLOBALS['HTTP_POST_VARS']["folderAction"] 
== "changeFolder")
                                {
!                                       #print "change folder<br>";
!                                       $this->mailbox = 
$GLOBALS['HTTP_POST_VARS']["mailbox"];
!                                       $this->startMessage = "1";
!                                       $this->sort = "6";
                                }
                                
elseif($GLOBALS['HTTP_POST_VARS']["folderAction"] == "moveMessage")
                                {
!                                       #print "move messages<br>";
!                                       $this->mailbox = 
urldecode($GLOBALS['HTTP_POST_VARS']["oldMailbox"]);
!                                       $this->startMessage = "1";
!                                       $this->sort = "6";
                                        if 
(is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                                        {
--- 45,84 ----
                        if(isset($GLOBALS['HTTP_POST_VARS']["mark_deleted_x"])) 
                                $GLOBALS['HTTP_POST_VARS']["mark_deleted"] = 
"true";
+ 
+                       $this->bofelamimail             = 
CreateObject('felamimail.bofelamimail');
+                       
                        
!                       if($GLOBALS['HTTP_POST_VARS']["changeFilter"] == 
'changeFilter' &&
!                               isset($GLOBALS['HTTP_POST_VARS']["filter"]))
!                       {
!                               // change filter
!                               
$this->bofelamimail->sessionData['activeFilter'] = 
$GLOBALS['HTTP_POST_VARS']["filter"];
!                       }
!                       elseif(isset($GLOBALS['HTTP_GET_VARS']["filter"]))
!                       {
!                               // change filter
!                               
$this->bofelamimail->sessionData['activeFilter'] = 
$GLOBALS['HTTP_GET_VARS']["filter"];
!                       }
!                       elseif(isset($GLOBALS['HTTP_POST_VARS']["mailbox"]) && 
                                $GLOBALS['HTTP_GET_VARS']["menuaction"] == 
"felamimail.uifelamimail.handleButtons" &&
!                               
empty($GLOBALS['HTTP_POST_VARS']["mark_unread"]) &&
!                               empty($GLOBALS['HTTP_POST_VARS']["mark_read"]) 
&&
!                               
empty($GLOBALS['HTTP_POST_VARS']["mark_unflagged"]) &&
!                               
empty($GLOBALS['HTTP_POST_VARS']["mark_flagged"]) &&
!                               
empty($GLOBALS['HTTP_POST_VARS']["mark_deleted"]))
                        {
                                if ($GLOBALS['HTTP_POST_VARS']["folderAction"] 
== "changeFolder")
                                {
!                                       // change folder
!                                       
$this->bofelamimail->sessionData['mailbox']     = 
$GLOBALS['HTTP_POST_VARS']["mailbox"];
!                                       
$this->bofelamimail->sessionData['startMessage']= 1;
!                                       
$this->bofelamimail->sessionData['sort']        = 6;
!                                       
$this->bofelamimail->sessionData['activeFilter']= -1;
                                }
                                
elseif($GLOBALS['HTTP_POST_VARS']["folderAction"] == "moveMessage")
                                {
!                                       //print "move messages<br>";
!                                       
$this->bofelamimail->sessionData['mailbox']     = 
urldecode($GLOBALS['HTTP_POST_VARS']["oldMailbox"]);
!                                       
$this->bofelamimail->sessionData['startMessage']= 1;
                                        if 
(is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                                        {
***************
*** 74,125 ****
                        elseif(isset($GLOBALS['HTTP_POST_VARS']["mailbox"]) &&
                                $GLOBALS['HTTP_GET_VARS']["menuaction"] == 
"felamimail.uifelamimail.handleButtons" &&
!                               
isset($GLOBALS['HTTP_POST_VARS']["mark_unread"]) ||
!                               isset($GLOBALS['HTTP_POST_VARS']["mark_read"]) 
||
!                               
isset($GLOBALS['HTTP_POST_VARS']["mark_unflagged"]) ||
!                               
isset($GLOBALS['HTTP_POST_VARS']["mark_flagged"]) ||
!                               
isset($GLOBALS['HTTP_POST_VARS']["mark_deleted"]))
!                       {
!                               $this->mailbox = 
urldecode($GLOBALS['HTTP_POST_VARS']["mailbox"]);
!                               $this->startMessage = "1";
!                               $this->sort = "6";
                        }
!                       else
                        {
!                               if ($GLOBALS['HTTP_GET_VARS']["mailbox"])
!                               {
!                                       $this->mailbox = 
$GLOBALS['HTTP_GET_VARS']["mailbox"];
!                               }
!                               else
!                               {
!                                       $this->mailbox = "INBOX";
!                               }
!                               
!                               if ($GLOBALS['HTTP_GET_VARS']["startMessage"])
!                               {
!                                       $this->startMessage = 
$GLOBALS['HTTP_GET_VARS']["startMessage"];
!                               }
!                               else
!                               {
!                                       $this->startMessage = "1";
!                               }
  
!                               if (isset($GLOBALS['HTTP_GET_VARS']["sort"]))
!                               {
!                                       $this->sort = 
$GLOBALS['HTTP_GET_VARS']["sort"];
!                               }
!                               else
!                               {
!                                       $this->sort = "6";
!                               }
                        }
  
                        #$this->cats                    = 
CreateObject('phpgwapi.categories');
                        #$this->nextmatchs              = 
CreateObject('phpgwapi.nextmatchs');
!                                               #$this->account                 
= $phpgw_info['user']['account_id'];
                        $this->t                        = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        #$this->grants                  = 
$phpgw->acl->get_grants('notes');
                        #$this->grants[$this->account]  = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
!                       $this->bofelamimail             = 
CreateObject('felamimail.bofelamimail',$this->mailbox);
!                       
                        $this->rowColor[0] = $phpgw_info["theme"]["row_on"];
                        $this->rowColor[1] = $phpgw_info["theme"]["row_off"];
--- 90,129 ----
                        elseif(isset($GLOBALS['HTTP_POST_VARS']["mailbox"]) &&
                                $GLOBALS['HTTP_GET_VARS']["menuaction"] == 
"felamimail.uifelamimail.handleButtons" &&
!                               
!empty($GLOBALS['HTTP_POST_VARS']["mark_deleted"]))
!                       {
!                               // delete messages
!                               
$this->bofelamimail->sessionData['startMessage']= 1;
                        }
!                       elseif($GLOBALS['HTTP_GET_VARS']["menuaction"] == 
"felamimail.uifelamimail.deleteMessage")
                        {
!                               // delete 1 message from the mail reading window
!                               
$this->bofelamimail->sessionData['startMessage']= 1;
!                       }
  
!                       // navigate for and back
!                       if(isset($GLOBALS['HTTP_GET_VARS']["startMessage"]))
!                       {
!                               
$this->bofelamimail->sessionData['startMessage'] = 
$GLOBALS['HTTP_GET_VARS']["startMessage"];
!                       }
!                       // change sorting
!                       if(isset($GLOBALS['HTTP_GET_VARS']["sort"]))
!                       {
!                               $this->bofelamimail->sessionData['sort'] = 
$GLOBALS['HTTP_GET_VARS']["sort"];
                        }
+                       $this->bofelamimail->saveSessionData();
+                       
+                       $this->mailbox          = 
$this->bofelamimail->sessionData['mailbox'];
+                       $this->startMessage     = 
$this->bofelamimail->sessionData['startMessage'];
+                       $this->sort             = 
$this->bofelamimail->sessionData['sort'];
+                       $this->filter           = 
$this->bofelamimail->sessionData['activeFilter'];
  
                        #$this->cats                    = 
CreateObject('phpgwapi.categories');
                        #$this->nextmatchs              = 
CreateObject('phpgwapi.nextmatchs');
!                       #$this->account                 = 
$phpgw_info['user']['account_id'];
                        $this->t                        = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
                        #$this->grants                  = 
$phpgw->acl->get_grants('notes');
                        #$this->grants[$this->account]  = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
!                       $this->connectionStatus = 
$this->bofelamimail->openConnection();
! 
                        $this->rowColor[0] = $phpgw_info["theme"]["row_on"];
                        $this->rowColor[1] = $phpgw_info["theme"]["row_off"];
***************
*** 130,133 ****
--- 134,169 ----
                }
  
+               function addVcard()
+               {
+                       $messageID      = 
$GLOBALS['HTTP_GET_VARS']['messageID'];
+                       $partID         = $GLOBALS['HTTP_GET_VARS']['partID'];
+                       $attachment = 
$this->bofelamimail->getAttachment($messageID,$partID);
+                       
+                       $tmpfname = tempnam 
($GLOBALS['phpgw_info']['server']['temp_dir'], "phpgw_");
+                       $fp = fopen($tmpfname, "w");
+                       fwrite($fp, $attachment['attachment']);
+                       fclose($fp);
+                       
+                       $vcard = CreateObject('phpgwapi.vcard');
+                       $entry = $vcard->in_file($tmpfname);
+                       $entry['owner'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $entry['access'] = 'private';
+                       $entry['tid'] = 'n';
+                       
+                       _debug_array($entry);
+                       print "<br><br>";
+                       
+                       print quoted_printable_decode($entry['fn'])."<br>";
+                       
+                       #$boaddressbook = 
CreateObject('addressbook.boaddressbook');
+                       #$soaddressbook = 
CreateObject('addressbook.soaddressbook');
+                       #$soaddressbook->add_entry($entry);
+                       #$ab_id = $boaddressbook->get_lastid();
+                       
+                       unlink($tmpfname);
+                       
+                       $GLOBALS['phpgw']->common->phpgw_exit();
+               }
+ 
                function compressFolder()
                {
***************
*** 161,165 ****
                        }
                        
!                       
elseif(isset($GLOBALS['HTTP_POST_VARS']["mark_deleted"]) &&
                                is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
--- 197,201 ----
                        }
                        
!                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_deleted"]) &&
                                is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
***************
*** 167,171 ****
                        }
                        
!                       elseif(isset($GLOBALS['HTTP_POST_VARS']["mark_unread"]) 
&&
                                is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
--- 203,207 ----
                        }
                        
!                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_unread"]) &&
                                is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
***************
*** 173,177 ****
                        }
                        
!                       elseif(isset($GLOBALS['HTTP_POST_VARS']["mark_read"]) &&
                                is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
--- 209,213 ----
                        }
                        
!                       elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_read"]) 
&&
                                is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
***************
*** 179,183 ****
                        }
                        
!                       
elseif(isset($GLOBALS['HTTP_POST_VARS']["mark_unflagged"]) &&
                                is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
--- 215,219 ----
                        }
                        
!                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_unflagged"]) &&
                                is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
***************
*** 185,189 ****
                        }
                        
!                       
elseif(isset($GLOBALS['HTTP_POST_VARS']["mark_flagged"]) &&
                                is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
--- 221,225 ----
                        }
                        
!                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_flagged"]) &&
                                is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
***************
*** 197,201 ****
                function viewMainScreen()
                {
!                       $bopreferences          = 
CreateObject('felamimail.bopreferences');
                        $mailPreferences        = 
$bopreferences->getPreferences();
  
--- 233,238 ----
                function viewMainScreen()
                {
!                       $bopreferences          = 
CreateObject('felamimail.bopreferences');
!                       $bofilter               = 
CreateObject('felamimail.bofilter');
                        $mailPreferences        = 
$bopreferences->getPreferences();
  
***************
*** 204,210 ****
                        $maxMessages = 
$GLOBALS['phpgw_info']["user"]["preferences"]["common"]["maxmatchs"];
                        
-                       $folders = $this->bofelamimail->getFolderList('true');
-                       
-                       $headers = 
$this->bofelamimail->getHeaders($this->startMessage, $maxMessages, $this->sort);
                
                        $this->display_app_header();
--- 241,244 ----
***************
*** 216,236 ****
                        $this->t->set_block('body','header_row_');
                        $this->t->set_block('body','header_row_AS');
                        $this->t->set_block('body','header_row_ADS');
                        $this->t->set_block('body','header_row_F');
                        $this->t->set_block('body','header_row_FS');
                        $this->t->set_block('body','header_row_FAS');
                        $this->t->set_block('body','header_row_R');
                        $this->t->set_block('body','header_row_D');
                        $this->t->set_block('body','header_row_DS');
!               
                        $this->translate();
                        
                        $this->t->set_var('oldMailbox',$urlMailbox);
                        $this->t->set_var('image_path',PHPGW_IMAGES);
                        
                        // set the default values for the sort links (sort by 
url)
                        $linkData = array
                        (
-                               'mailbox'       => $urlMailbox,
                                'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
                                'startMessage'  => 1,
--- 250,289 ----
                        $this->t->set_block('body','header_row_');
                        $this->t->set_block('body','header_row_AS');
+                       $this->t->set_block('body','header_row_RAS');
                        $this->t->set_block('body','header_row_ADS');
                        $this->t->set_block('body','header_row_F');
+                       $this->t->set_block('body','header_row_FA');
                        $this->t->set_block('body','header_row_FS');
                        $this->t->set_block('body','header_row_FAS');
                        $this->t->set_block('body','header_row_R');
+                       $this->t->set_block('body','header_row_RS');
                        $this->t->set_block('body','header_row_D');
                        $this->t->set_block('body','header_row_DS');
!                       $this->t->set_block('body','header_row_A');
!                       $this->t->set_block('body','error_message');
! 
                        $this->translate();
                        
                        $this->t->set_var('oldMailbox',$urlMailbox);
                        $this->t->set_var('image_path',PHPGW_IMAGES);
+                       $refreshTime = 
$GLOBALS['phpgw_info']['user']['preferences'][felamimail]['refreshTime'];
+                       if($refreshTime > 0)
+                       {
+                               
$this->t->set_var('refreshTime',sprintf("setTimeout( \"refresh()\", %s 
);",$refreshTime*60*1000));
+                       }
+                       else
+                       {
+                               $this->t->set_var('refreshTime','');
+                       }
+                       // set the url to open when refreshing
+                       $linkData = array
+                       (
+                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen'
+                       );
+                       
$this->t->set_var('refresh_url',$GLOBALS['phpgw']->link('/index.php',$linkData));
                        
                        // set the default values for the sort links (sort by 
url)
                        $linkData = array
                        (
                                'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
                                'startMessage'  => 1,
***************
*** 242,246 ****
                        $linkData = array
                        (
-                               'mailbox'       => $urlMailbox,
                                'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
                                'startMessage'  => 1,
--- 295,298 ----
***************
*** 252,256 ****
                        $linkData = array
                        (
-                               'mailbox'       => $urlMailbox,
                                'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
                                'startMessage'  => 1,
--- 304,307 ----
***************
*** 258,262 ****
                        );
                        
$this->t->set_var('url_sort_subject',$GLOBALS['phpgw']->link('/index.php',$linkData));
!               
                        // create the urls for sorting
                        switch($this->sort)
--- 309,327 ----
                        );
                        
$this->t->set_var('url_sort_subject',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                       
!                       // create the filter ui
!                       $filterList = $bofilter->getFilterList();
!                       if($this->filter == -1)
!                               $filterUI .= "<option value=\"-1\">".lang('no 
filter')."</option>";
!                       else
!                               $filterUI .= "<option value=\"-1\" 
selected>".lang('no filter')."</option>";
!                       while(list($key,$value) = @each($filterList))
!                       {
!                               $selected="";
!                               if($this->filter == $key) $selected="selected";
!                               $filterUI .= "<option value=".$key." 
$selected>".$value['filterName']."</option>";
!                       }
!                       $this->t->set_var('filter_options',$filterUI);
!                       
                        // create the urls for sorting
                        switch($this->sort)
***************
*** 265,269 ****
                                        $linkData = array
                                        (
-                                               'mailbox'       => $urlMailbox,
                                                'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
                                                'startMessage'  => 1,
--- 330,333 ----
***************
*** 276,280 ****
                                        $linkData = array
                                        (
-                                               'mailbox'       => $urlMailbox,
                                                'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
                                                'startMessage'  => 1,
--- 340,343 ----
***************
*** 287,291 ****
                                        $linkData = array
                                        (
-                                               'mailbox'       => $urlMailbox,
                                                'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
                                                'startMessage'  => 1,
--- 350,353 ----
***************
*** 297,432 ****
                        }
  
!                       // create the listing of subjects
!                       $maxSubjectLength = 80;
!                       $maxAddressLength = 30;
!                       for($i=0; $i<count($headers['header']); $i++)
                        {
!                               if (!empty($headers['header'][$i]['subject']))
                                {
!                                       
if(strlen($headers['header'][$i]['subject']) > $maxSubjectLength)
                                        {
!                                               
$headers['header'][$i]['subject'] = 
substr($headers['header'][$i]['subject'],0,$maxSubjectLength)."...";
                                        }
! 
!                                       
if($headers['header'][$i]['attachments'] == "true")
                                        {
!                                               $image = '<img 
src="'.PHPGW_IMAGES.'/attach.gif" border="0">';
!                                               
$headers['header'][$i]['subject'] = 
"$image&nbsp;".$headers['header'][$i]['subject'];
                                        }
-                                       
$this->t->set_var('header_subject',$headers['header'][$i]['subject']);
-                                       
-                               }
-                               else
-                               {
-                                       
$this->t->set_var('header_subject',"(".lang('no subject').")");
-                               }
                                
!                               if ($mailPreferences['sent_folder'] == 
$this->mailbox)
!                               {
!                                       if 
(!empty($headers['header'][$i]['to_name']))
                                        {
!                                               $sender_name    = 
$headers['header'][$i]['to_name'];
!                                               $full_address   =
!                                                       
$headers['header'][$i]['to_name'].
!                                                       " <".
!                                                       
$headers['header'][$i]['to_address'].
!                                                       ">";
                                        }
                                        else
                                        {
!                                               $sender_name    = 
$headers['header'][$i]['to_address'];
!                                               $full_address   = 
$headers['header'][$i]['to_address'];
                                        }
!                                       
$this->t->set_var('lang_from',lang("to"));
!                               }
!                               else
!                               {
!                                       if 
(!empty($headers['header'][$i]['sender_name']))
                                        {
!                                               $sender_name    = 
$headers['header'][$i]['sender_name'];
!                                               $full_address   = 
!                                                       
$headers['header'][$i]['sender_name'].
!                                                       " <".
!                                                       
$headers['header'][$i]['sender_address'].
!                                                       ">";
                                        }
!                                       else
                                        {
!                                               $sender_name    = 
$headers['header'][$i]['sender_address'];
!                                               $full_address   = 
$headers['header'][$i]['sender_address'];
                                        }
-                                       
$this->t->set_var('lang_from',lang("from"));
-                               }
-                               if(strlen($sender_name) > $maxAddressLength)
-                               {
-                                       $sender_name = 
substr($sender_name,0,$maxAddressLength)."...";
-                               }
-                               $this->t->set_var('sender_name',$sender_name);
-                               $this->t->set_var('full_address',$full_address);
-                               
-                               if($GLOBALS['HTTP_GET_VARS']["select_all"] == 
"select_all")
-                               {
-                                       
$this->t->set_var('row_selected',"checked");
-                               }
- 
-                               $this->t->set_var('message_counter',$i);
-                               
$this->t->set_var('message_uid',$headers['header'][$i]['uid']);
-                               
$this->t->set_var('date',$headers['header'][$i]['date']);
-                               
$this->t->set_var('size',$this->show_readable_size($headers['header'][$i]['size']));
-                               $flags = "";
-                               if(!empty($headers['header'][$i]['recent'])) 
$flags .= "R";
-                               if(!empty($headers['header'][$i]['flagged'])) 
$flags .= "F";
-                               if(!empty($headers['header'][$i]['answered'])) 
$flags .= "A";
-                               if(!empty($headers['header'][$i]['deleted'])) 
$flags .= "D";
-                               if(!empty($headers['header'][$i]['seen'])) 
$flags .= "S";
-                               #$this->t->set_var('flags',$flags);
  
!                               $linkData = array
!                               (
!                                       'mailbox'       => $urlMailbox,
!                                       'passed_id'     => 
$headers['header'][$i]['id'],
!                                       'uid'           => 
$headers['header'][$i]['uid'],
!                                       'startMessage'  => $this->startMessage,
!                                       'sort'          => $this->sort
!                               );
!                               
$this->t->set_var('url_read_message',$GLOBALS['phpgw']->link('/felamimail/read_body.php',$linkData));
                                
!                               $linkData = array
!                               (
!                                       'menuaction'    => 
'felamimail.uicompose.compose',
!                                       'mailbox'       => $urlMailbox,
!                                       'startMessage'  => $this->startMessage,
!                                       'sort'          => $this->sort,
!                                       'send_to'       => 
urlencode($headers['header'][$i]['sender_address'])
!                               );
!                               
$this->t->set_var('url_compose',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                               
!                               $linkData = array
!                               (
!                                       'menuaction'    => 
'addressbook.uiaddressbook.add_email',
!                                       'add_email'     => 
urlencode($headers['header'][$i]['sender_address']),
!                                       'name'          => 
urlencode($headers['header'][$i]['sender_name']),
!                                       'referer'       => 
urlencode($GLOBALS['PHP_SELF'].'?'.$GLOBALS['QUERY_STRING'])
!                               );
!                               
$this->t->set_var('url_add_to_addressbook',$GLOBALS['phpgw']->link('/index.php',$linkData));
                                
!                               $this->t->set_var('phpgw_images',PHPGW_IMAGES);
                        
!                               
$this->t->parse('header_rows','header_row_'.$flags,True);
                        }
!                       $firstMessage = $headers['info']['first'];
!                       $lastMessage = $headers['info']['last'];
!                       $totalMessage = $headers['info']['total'];
!                       $langTotal = lang("total");
! 
                        // set the select all/nothing link
                        if($GLOBALS['HTTP_GET_VARS']["select_all"] == 
"select_all")
                        {
                                $linkData = array
                                (
!                                       'mailbox'       => $urlMailbox,
!                                       'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
!                                       'startMessage'  => $this->startMessage,
!                                       'sort'          => $this->sort
                                );
                                $selectLink = sprintf("<a class=\"body_link\" 
href=\"%s\">%s</a>",
--- 359,508 ----
                        }
  
!                       if($this->connectionStatus != 'True')
!                       {
!                               
$this->t->set_var('message',$this->connectionStatus);
!                               
$this->t->parse('header_rows','error_message',True);
!                       }
!                       else
                        {
!                               $folders = 
$this->bofelamimail->getFolderList('true');
!                       
!                               $headers = 
$this->bofelamimail->getHeaders($this->startMessage, $maxMessages, $this->sort);
!                       
!                               // create the listing of subjects
!                               $maxSubjectLength = 80;
!                               $maxAddressLength = 30;
!                               for($i=0; $i<count($headers['header']); $i++)
                                {
!                                       if 
(!empty($headers['header'][$i]['subject']))
                                        {
!                                               // make the subject shorter if 
it is to long
!                                               
if(strlen($headers['header'][$i]['subject']) > $maxSubjectLength)
!                                               {
!                                                       
$headers['header'][$i]['subject'] = 
substr($headers['header'][$i]['subject'],0,$maxSubjectLength)."...";
!                                               }
!                                               
$headers['header'][$i]['subject'] = 
htmlentities($headers['header'][$i]['subject']);
!                                               
if($headers['header'][$i]['attachments'] == "true")
!                                               {
!                                                       $image = '<img 
src="'.PHPGW_IMAGES.'/attach.gif" border="0">';
!                                                       
$headers['header'][$i]['subject'] = 
"$image&nbsp;".$headers['header'][$i]['subject'];
!                                               }
!                                               
$this->t->set_var('header_subject', $headers['header'][$i]['subject']);
!                                       
                                        }
!                                       else
                                        {
!                                               
$this->t->set_var('header_subject',htmlentities("(".lang('no subject').")"));
                                        }
                                
!                                       if ($mailPreferences['sent_folder'] == 
$this->mailbox)
                                        {
!                                               if 
(!empty($headers['header'][$i]['to_name']))
!                                               {
!                                                       $sender_name    = 
$headers['header'][$i]['to_name'];
!                                                       $full_address   =
!                                                               
$headers['header'][$i]['to_name'].
!                                                               " <".
!                                                               
$headers['header'][$i]['to_address'].
!                                                               ">";
!                                               }
!                                               else
!                                               {
!                                                       $sender_name    = 
$headers['header'][$i]['to_address'];
!                                                       $full_address   = 
$headers['header'][$i]['to_address'];
!                                               }
!                                               
$this->t->set_var('lang_from',lang("to"));
                                        }
                                        else
                                        {
!                                               if 
(!empty($headers['header'][$i]['sender_name']))
!                                               {
!                                                       $sender_name    = 
$headers['header'][$i]['sender_name'];
!                                                       $full_address   = 
!                                                               
$headers['header'][$i]['sender_name'].
!                                                               " <".
!                                                               
$headers['header'][$i]['sender_address'].
!                                                               ">";
!                                               }
!                                               else
!                                               {
!                                                       $sender_name    = 
$headers['header'][$i]['sender_address'];
!                                                       $full_address   = 
$headers['header'][$i]['sender_address'];
!                                               }
!                                               
$this->t->set_var('lang_from',lang("from"));
                                        }
!                                       if(strlen($sender_name) > 
$maxAddressLength)
                                        {
!                                               $sender_name = 
substr($sender_name,0,$maxAddressLength)."...";
                                        }
!                                       
$this->t->set_var('sender_name',$sender_name);
!                                       
$this->t->set_var('full_address',$full_address);
!                               
!                                       
if($GLOBALS['HTTP_GET_VARS']["select_all"] == "select_all")
                                        {
!                                               
$this->t->set_var('row_selected',"checked");
                                        }
  
!                                       $this->t->set_var('message_counter',$i);
!                                       
$this->t->set_var('message_uid',$headers['header'][$i]['uid']);
!                                       
$this->t->set_var('date',$headers['header'][$i]['date']);
!                                       
$this->t->set_var('size',$this->show_readable_size($headers['header'][$i]['size']));
!                                       $flags = "";
!                                       
if(!empty($headers['header'][$i]['recent'])) $flags .= "R";
!                                       
if(!empty($headers['header'][$i]['flagged'])) $flags .= "F";
!                                       
if(!empty($headers['header'][$i]['answered'])) $flags .= "A";
!                                       
if(!empty($headers['header'][$i]['deleted'])) $flags .= "D";
!                                       
if(!empty($headers['header'][$i]['seen'])) $flags .= "S";
!                                       #$this->t->set_var('flags',$flags);     
! 
! #                                     $linkData = array
! #                                     (
! #                                             'mailbox'       => $urlMailbox,
! #                                             'passed_id'     => 
$headers['header'][$i]['id'],
! #                                             'uid'           => 
$headers['header'][$i]['uid'],
! #                                     );
! #                                     
$this->t->set_var('url_read_message',$GLOBALS['phpgw']->link('/felamimail/read_body.php',$linkData));
                                
!                                       $linkData = array
!                                       (
!                                               'menuaction'    => 
'felamimail.uidisplay.display',
!                                               'showHeader'    => 'false',
!                                               'uid'           => 
$headers['header'][$i]['uid']
!                                       );
!                                       
$this->t->set_var('url_read_message',$GLOBALS['phpgw']->link('/index.php',$linkData));
                                
!                                       $linkData = array
!                                       (
!                                               'menuaction'    => 
'felamimail.uicompose.compose',
!                                               'send_to'       => 
urlencode($headers['header'][$i]['sender_address'])
!                                       );
!                                       
$this->t->set_var('url_compose',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                                       
!                                       $linkData = array
!                                       (
!                                               'menuaction'    => 
'addressbook.uiaddressbook.add_email',
!                                               'add_email'     => 
urlencode($headers['header'][$i]['sender_address']),
!                                               'name'          => 
urlencode($headers['header'][$i]['sender_name']),
!                                               'referer'       => 
urlencode($GLOBALS['PHP_SELF'].'?'.$GLOBALS['QUERY_STRING'])
!                                       );
!                                       
$this->t->set_var('url_add_to_addressbook',$GLOBALS['phpgw']->link('/index.php',$linkData));
!                                       
!                                       
$this->t->set_var('phpgw_images',PHPGW_IMAGES);
                        
!                                       
$this->t->parse('header_rows','header_row_'.$flags,True);
!                               }
!                               $firstMessage = $headers['info']['first'];
!                               $lastMessage = $headers['info']['last'];
!                               $totalMessage = $headers['info']['total'];
!                               $langTotal = lang("total");             
                        }
!                       
                        // set the select all/nothing link
                        if($GLOBALS['HTTP_GET_VARS']["select_all"] == 
"select_all")
                        {
+                               // link to unselect all messages
                                $linkData = array
                                (
!                                       'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen'
                                );
                                $selectLink = sprintf("<a class=\"body_link\" 
href=\"%s\">%s</a>",
***************
*** 438,448 ****
                        else
                        {
                                $linkData = array
                                (
-                                       'mailbox'       => $urlMailbox,
                                        'select_all'    => 'select_all',
!                                       'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
!                                       'startMessage'  => $this->startMessage,
!                                       'sort'          => $this->sort
                                );
                                $selectLink = sprintf("<a class=\"body_link\" 
href=\"%s\">%s</a>",
--- 514,522 ----
                        else
                        {
+                               // link to select all messages
                                $linkData = array
                                (
                                        'select_all'    => 'select_all',
!                                       'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen'
                                );
                                $selectLink = sprintf("<a class=\"body_link\" 
href=\"%s\">%s</a>",
***************
*** 463,470 ****
                                $linkData = array
                                (
!                                       'mailbox'       => $urlMailbox,
!                                       'menuaction'    => 
'felamimail.uifelamimail.compressFolder',
!                                       'startMessage'  => $this->startMessage,
!                                       'sort'          => $this->sort
                                );
                                $trashLink = sprintf("<a class=\"body_link\" 
href=\"%s\">%s</a>",
--- 537,541 ----
                                $linkData = array
                                (
!                                       'menuaction'    => 
'felamimail.uifelamimail.compressFolder'
                                );
                                $trashLink = sprintf("<a class=\"body_link\" 
href=\"%s\">%s</a>",
***************
*** 478,485 ****
                                $linkData = array
                                (
!                                       'mailbox'       => $urlMailbox,
!                                       'menuaction'    => 
'felamimail.uifelamimail.compressFolder',
!                                       'startMessage'  => $this->startMessage,
!                                       'sort'          => $this->sort
                                );
                                $trashLink = sprintf("<a class=\"body_link\" 
href=\"%s\">%s</a>",
--- 549,553 ----
                                $linkData = array
                                (
!                                       'menuaction'    => 
'felamimail.uifelamimail.compressFolder'
                                );
                                $trashLink = sprintf("<a class=\"body_link\" 
href=\"%s\">%s</a>",
***************
*** 495,502 ****
                                $linkData = array
                                (
-                                       'mailbox'       => $urlMailbox,
                                        'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
!                                       'startMessage'  => $this->startMessage 
- $maxMessages,
!                                       'sort'          => $this->sort
                                );
                                $link = 
$GLOBALS['phpgw']->link('/index.php',$linkData);
--- 563,568 ----
                                $linkData = array
                                (
                                        'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
!                                       'startMessage'  => $this->startMessage 
- $maxMessages
                                );
                                $link = 
$GLOBALS['phpgw']->link('/index.php',$linkData);
***************
*** 512,519 ****
                                $linkData = array
                                (
-                                       'mailbox'       => $urlMailbox,
                                        'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
!                                       'startMessage'  => $this->startMessage 
+ $maxMessages,
!                                       'sort'          => $this->sort
                                );
                                $link = 
$GLOBALS['phpgw']->link('/index.php',$linkData);
--- 578,583 ----
                                $linkData = array
                                (
                                        'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
!                                       'startMessage'  => $this->startMessage 
+ $maxMessages
                                );
                                $link = 
$GLOBALS['phpgw']->link('/index.php',$linkData);
***************
*** 542,549 ****
                        $linkData = array
                        (
!                               'menuaction'    => 
'felamimail.uicompose.compose',
!                               'mailbox'       => $urlMailbox,
!                               'startMessage'  => $this->startMessage,
!                               'sort'          => $this->sort,
                        );
                        
$this->t->set_var('url_compose_empty',$GLOBALS['phpgw']->link('/index.php',$linkData));
--- 606,610 ----
                        $linkData = array
                        (
!                               'menuaction'    => 
'felamimail.uicompose.compose'
                        );
                        
$this->t->set_var('url_compose_empty',$GLOBALS['phpgw']->link('/index.php',$linkData));
***************
*** 551,562 ****
                        $linkData = array
                        (
                                'menuaction'    => 
'felamimail.uifelamimail.handleButtons'
                        );
                        
$this->t->set_var('url_change_folder',$GLOBALS['phpgw']->link('/index.php',$linkData));
                                                                                
                                                                                
                                
                        $this->t->parse("out","main");
                        print $this->t->get('out','main');
                        
!                       $this->bofelamimail->closeConnection();
                        $GLOBALS['phpgw']->common->phpgw_footer();
                
--- 612,634 ----
                        $linkData = array
                        (
+                               'menuaction'    => 
'felamimail.uifilter.mainScreen'
+                       );
+                       
$this->t->set_var('url_filter',$GLOBALS['phpgw']->link('/index.php',$linkData));
+ 
+                       $linkData = array
+                       (
                                'menuaction'    => 
'felamimail.uifelamimail.handleButtons'
                        );
                        
$this->t->set_var('url_change_folder',$GLOBALS['phpgw']->link('/index.php',$linkData));
+                       $this->t->set_var('lang_mark_messages_as',lang('mark 
messages as'));
+                       $this->t->set_var('lang_delete_selected',lang('delete 
selected messages'));
                                                                                
                                                                                
                                
                        $this->t->parse("out","main");
                        print $this->t->get('out','main');
                        
!                       if($this->connectionStatus == 'True')
!                       {
!                               $this->bofelamimail->closeConnection();
!                       }
                        $GLOBALS['phpgw']->common->phpgw_footer();
                
***************
*** 586,589 ****
--- 658,667 ----
                        return $bytes . '<small>&nbsp;' . $type . '</small>';
                }
+               
+               function toggleFilter()
+               {
+                       $this->bofelamimail->toggleFilter();
+                       $this->viewMainScreen();
+               }
  
                function translate()
***************
*** 596,600 ****
  
                        $this->t->set_var('lang_compose',lang('compose'));
!                       $this->t->set_var('lang_search',lang('search'));
                        $this->t->set_var('lang_move_selected_to',lang('move 
selected to'));
                        $this->t->set_var('lang_doit',lang('do it!'));
--- 674,678 ----
  
                        $this->t->set_var('lang_compose',lang('compose'));
!                       $this->t->set_var('lang_edit_filter',lang('edit 
filter'));
                        $this->t->set_var('lang_move_selected_to',lang('move 
selected to'));
                        $this->t->set_var('lang_doit',lang('do it!'));
***************
*** 614,619 ****
--- 692,700 ----
                        $this->t->set_var('lang_recent',lang("recent"));
                        $this->t->set_var('lang_flagged',lang("flagged"));
+                       $this->t->set_var('lang_unflagged',lang("unflagged"));
                        $this->t->set_var('lang_subject',lang("subject"));
                        $this->t->set_var('lang_add_to_addressbook',lang("add 
to addressbook"));
+                       $this->t->set_var('lang_no_filter',lang("no filter"));
+                       $this->t->set_var('lang_connection_failed',lang("The 
connection to the IMAP Server failed!!"));
                }
        }

Index: date.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/date.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: display_messages.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/display_messages.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/hook_admin.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** hook_admin.inc.php  3 Nov 2002 01:03:05 -0000       1.5
--- hook_admin.inc.php  24 Nov 2002 00:32:13 -0000      1.6
***************
*** 1,24 ****
  <?php
!       
/**************************************************************************\
!       * phpGroupWare                                                          
   *
!       * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
!       /* $Id$ */
! 
!       {
  
  // Only Modify the $file and $title variables.....
!               $file = Array
!               (
!                       'Site Configuration' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=email')
!               );
! 
  //Do not modify below this line
!               display_section($appname,$file);
!       }
  ?>
--- 1,23 ----
  <?php
!   /**************************************************************************\
!   * phpGroupWare                                                             *
!   * http://www.phpgroupware.org                                              *
!   * Written by Joseph Engo <address@hidden>                          *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
  
+   /* $Id$ */
+ {
  // Only Modify the $file and $title variables.....
!       $title = $appname;
!       $file = Array(
!               'Site Configuration'    => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' 
. $appname)
!       );
  //Do not modify below this line
!       display_section($appname,$title,$file);
! }
  ?>

Index: hook_home.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/hook_home.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** hook_home.inc.php   26 Oct 2002 01:05:28 -0000      1.7
--- hook_home.inc.php   24 Nov 2002 00:32:13 -0000      1.8
***************
*** 47,54 ****
                else
                {
!                       $app_id = 
$GLOBALS['phpgw']->applications->name2id('felamimail');
                        $GLOBALS['portal_order'][] = $app_id;
!                       $GLOBALS['phpgw']->portalbox->set_params(array('app_id' 
=> $app_id,
!                                                                               
                                'title' => lang('felamimail')));                
                        /*  // this is the structure you will get
                          $inbox_data['is_imap'] boolean - pop3 server do not 
know what is "new" or not
--- 47,82 ----
                else
                {
!                       $title = '<font 
color="#FFFFFF">'.lang('E-Mail').'</font>';
!               
!                       $portalbox = CreateObject('phpgwapi.listbox',
!                               Array(
!                                       'title' => $title,
!                                       'primary'       => 
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
!                                       'secondary'     => 
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
!                                       'tertiary'      => 
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
!                                       'width' => '100%',
!                                       'outerborderwidth'      => '0',
!                                       'header_background_image'       => 
$GLOBALS['phpgw']->common->image('phpgwapi/templates/phpgw_website','bg_filler.gif')
!                               )
!                       );
! 
!                       $app_id = 
$GLOBALS['phpgw']->applications->name2id('calendar');
                        $GLOBALS['portal_order'][] = $app_id;
!                       $var = Array(
!                               'up'    => Array('url'  => '/set_box.php', 
'app'        => $app_id),
!                               'down'  => Array('url'  => '/set_box.php', 
'app'        => $app_id),
!                               'close' => Array('url'  => '/set_box.php', 
'app'        => $app_id),
!                               'question'      => Array('url'  => 
'/set_box.php', 'app'        => $app_id),
!                               'edit'  => Array('url'  => '/set_box.php', 
'app'        => $app_id)
!                       );
! 
!                       while(list($key,$value) = each($var))
!                       {
!                               $portalbox->set_controls($key,$value);
!                       }
! 
!                       $portalbox->data = Array();
! 
!               
                        /*  // this is the structure you will get
                          $inbox_data['is_imap'] boolean - pop3 server do not 
know what is "new" or not
***************
*** 123,129 ****
                        if($data)
                        {
!                               $GLOBALS['phpgw']->portalbox->data = $data;
                        }
!                       $GLOBALS['phpgw']->portalbox->draw($extra_data);
                }
        }
--- 151,161 ----
                        if($data)
                        {
!                               $portalbox->data = $data;
                        }
! 
!                       // 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)
!                               .'<!-- ends Mailox info -->'."\r\n";
                }
        }

Index: hook_preferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/hook_preferences.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** hook_preferences.inc.php    13 Apr 2002 04:22:28 -0000      1.7
--- hook_preferences.inc.php    24 Nov 2002 00:32:13 -0000      1.8
***************
*** 15,19 ****
--- 15,26 ----
  // Only Modify the $file and $title variables.....
        $title = $appname;
+       $sieveLinkData = array
+       (
+               'menuaction'    => 'felamimail.uisieve.mainScreen',
+               'action'        => 'updateFilter'
+       );
+                                         
        $file = array(
+               'Mail Settings '          => 
$GLOBALS['phpgw']->link('/preferences/preferences.php','appname=felamimail'),
                'Mail Settings'           => 
$GLOBALS['phpgw']->link('/felamimail/preferences_email.php'),
                'Message Highlighting'    => 
$GLOBALS['phpgw']->link('/felamimail/preferences_highlight.php'),
***************
*** 21,25 ****
--- 28,34 ----
                'Translation Preferences' => 
$GLOBALS['phpgw']->link('/felamimail/preferences_translate.php'),
                'Display Preferences'     => 
$GLOBALS['phpgw']->link('/felamimail/preferences_display.php'),
+               'Manage Sieve'            => 
$GLOBALS['phpgw']->link('/index.php',$sieveLinkData),
                'Folder Preferences'      => 
$GLOBALS['phpgw']->link('/felamimail/preferences_folder.php'),
+               'Manage Folders '         => 
$GLOBALS['phpgw']->link('/index.php','menuaction=felamimail.uipreferences.listFolder'),
                'Manage Folders'          => 
$GLOBALS['phpgw']->link('/felamimail/folders.php') 
        );

Index: i18n.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/i18n.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: imap.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/imap.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: imap_general.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/imap_general.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** imap_general.php    27 Mar 2002 22:06:44 -0000      1.3
--- imap_general.php    24 Nov 2002 00:32:13 -0000      1.4
***************
*** 127,131 ****
                }
  
!               fputs ($imap_stream, "a001 LOGIN \"" . quotemeta($username) . 
'" "' . quotemeta($password) . "\"\r\n");
                $read = sqimap_read_data ($imap_stream, 'a001', false, 
$response, $message);
  
--- 127,133 ----
                }
  
!               # BUG 1592
!               # fputs ($imap_stream, "a001 LOGIN \"" . quotemeta($username) . 
'" "' . quotemeta($password) . "\"\r\n");
!               fputs ($imap_stream, "a001 LOGIN \"" . $username . '" "' . 
quotemeta($password) . "\"\r\n");
                $read = sqimap_read_data ($imap_stream, 'a001', false, 
$response, $message);
  

Index: imap_mailbox.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/imap_mailbox.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: imap_messages.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/imap_messages.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: imap_search.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/imap_search.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: mailbox_display.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/mailbox_display.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: mime.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/mime.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** mime.php    27 Mar 2002 22:06:44 -0000      1.3
--- mime.php    24 Nov 2002 00:32:13 -0000      1.4
***************
*** 586,591 ****
                 $ent = urlencode($message->header->entity_id);
                 
-                $DefaultLink = $phpgw->link(
-                   
"/felamimail/download.php","startMessage=$startMessage&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent");
                 if ($where && $what)
                    $DefaultLink .= '&where=' . urlencode($where) . '&what=' . 
urlencode($what);
--- 586,589 ----
***************
*** 595,607 ****
                 $ImageURL = '';
                 
-                $HookResults = do_hook("attachment $type0/$type1", $Links,
-                    $startMessage, $id, $urlMailbox, $ent, $DefaultLink, 
-                    $display_filename, $where, $what);
- 
-                $Links = $HookResults[1];
-                $DefaultLink = $HookResults[6];
- 
                 $body .= '<TR><TD>&nbsp;&nbsp;</TD><TD>';
!                $body .= "<A 
HREF=\"$DefaultLink\">$display_filename</A>&nbsp;</TD>";
                 $body .= '<TD><SMALL><b>' . 
show_readable_size($message->header->size) . 
                     '</b>&nbsp;&nbsp;</small></TD>';
--- 593,647 ----
                 $ImageURL = '';
                 
                 $body .= '<TR><TD>&nbsp;&nbsp;</TD><TD>';
!                       switch("$type0/$type1")
!                       {
!                               case "text/x-vcard":
!                               $bofelamimail   = 
CreateObject('felamimail.bofelamimail',$mailbox);
!                               $vcard          = 
CreateObject('phpgwapi.vcard');
!                               
!                               $attachment     = 
$bofelamimail->getAttachment($GLOBALS['HTTP_GET_VARS']['uid'],$ent);
!                               $tmpfname       = tempnam 
($GLOBALS['phpgw_info']['server']['temp_dir'], "phpgw_");
!                               $fp             = fopen($tmpfname, "w");
!                               fwrite($fp, $attachment['attachment']);
!                               fclose($fp);
!                               
!                               $entry  = $vcard->in_file($tmpfname);
!                               $entry['owner'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
!                               $entry['access'] = 'private';
!                               $entry['tid'] = 'n';
!                               
!                               unlink($tmpfname);
!                               
!                               #_debug_array($entry);
!                               #print "<br><br>";
!                               
!                               if(isset($entry['fn'])) 
!                                       $display_filename  = 
htmlentities(quoted_printable_decode($entry['fn']))."<br>";
!                               if(isset($entry['org_name'])) 
!                                       $display_filename .= 
htmlentities(quoted_printable_decode($entry['org_name']))."<br>";
!                               if(isset($entry['adr_one_postalcode'])) 
!                                       $display_filename .= 
htmlentities(quoted_printable_decode($entry['adr_one_postalcode']))."&nbsp;";
!                               if(isset($entry['adr_one_locality'])) 
!                                       $display_filename .= 
htmlentities(quoted_printable_decode($entry['adr_one_locality']));
!                               $linkData = array
!                               (
!                                       'menuaction'    => 
'felamimail.uifelamimail.addVcard',
!                                       'startMessage'  => $startMessage,
!                                       'mailbox'       => $urlMailbox,
!                                       'messageID'     => 
$GLOBALS['HTTP_GET_VARS']['uid'],
!                                       'partID'        => $ent
!                               );
!                               $DefaultLink = 
$GLOBALS['phpgw']->link('/index.php',$linkData);
!                                       $body .= "<A HREF=\"$DefaultLink\" 
target=\"_blank\">$display_filename</A>&nbsp;</TD>";
!                               
!                                       break;
!                                       
!                               default:
!                              $DefaultLink = $phpgw->link(
!                                       
"/felamimail/download.php","startMessage=$startMessage&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent");
!                                       $body .= "<A HREF=\"$DefaultLink\" 
target=\"_blank\">$display_filename</A>&nbsp;</TD>";
!                                       
!                                       break;
!                       }
                 $body .= '<TD><SMALL><b>' . 
show_readable_size($message->header->size) . 
                     '</b>&nbsp;&nbsp;</small></TD>';

Index: page_header.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/page_header.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: plugin.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/plugin.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: prefs.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/prefs.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: smtp.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/smtp.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: strings.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/strings.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: tree.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/tree.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4

Index: url_parser.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/url_parser.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4





reply via email to

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