LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-04-2008, 02:00 AM   #1
taruvinga
LQ Newbie
 
Registered: Jun 2008
Posts: 6
Blog Entries: 1

Rep: Reputation: 0
Squirrelmail is not showing interface...


I have configured squirrel mail on RH9 using tarballs and it gives me the login interface but after login it doesn't show anythiung i.e the inboxes,etc.

When i checked my error logs it should me this error "Cannot re-assign $this in /home/squirrelmail/html/class/mime/Message.class.php on line 183"

this is my message.class.php;

vi mime.class.php
<?php

/**
* mime.class
*
* Copyright (c) 2003 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This contains functions needed to handle mime messages.
*
* $Id: mime.class.php,v 1.40 2002/12/31 12:49:29 kink Exp $
*/

require_once(SM_PATH . 'class/mime/Rfc822Header.class.php');
require_once(SM_PATH . 'class/mime/MessageHeader.class.php');
require_once(SM_PATH . 'class/mime/AddressStructure.class.php');
require_once(SM_PATH . 'class/mime/Message.class.php');
require_once(SM_PATH . 'class/mime/SMimeMessage.class.php');
require_once(SM_PATH . 'class/mime/Disposition.class.php');
require_once(SM_PATH . 'class/mime/Language.class.php');
require_once(SM_PATH . 'class/mime/ContentType.class.php');

?>
How can I make my squirrelmail work

TIA
 
Old 06-04-2008, 02:16 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Did you post the wrong file - the error relates to Message.class.php not mime.class.php?

That said did you run the squirrelmail config (conf.pl)?
 
Old 06-05-2008, 02:50 AM   #3
taruvinga
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Original Poster
Blog Entries: 1

Rep: Reputation: 0
Squirrelmail is not showing interface...

Hi

I guess I posted the wrong guy...this is wat I did I unzipped the file squirrelmail.1.4.0.tar.gz into a folder which I named squirrelmail. I placed the folder in /home/. Then specified my VirtualHost ..etc in httpd.conf.
Next I edited the ./configure file found in /home/squirrelmail/html.

I didn't do anything else....

When i commented the Message.class.php line in mime.class.php I could got the interface but obviously sum of the functions like composing and reading mail didn't work.

I have attached the Message.class.php although I didn't edit anything there:

}
return $msg->mailbox;
}

/*
* Bodystructure parser, a recursive function for generating the
* entity-tree with all the mime-parts.
*
* It follows RFC2060 and stores all the described fields in the
* message object.
*
* Question/Bugs:
*
* Ask for me (Marc Groot Koerkamp, stekkel@users.sourceforge.net)
*
*/
function parseStructure($read, &$i, $sub_msg = '') {
$msg = Message:arseBodyStructure($read, $i, $sub_msg);
if($msg) $msg->setEntIds($msg,false,0);
return $msg;
}

function setEntIds(&$msg,$init=false,$i=0) {
$iCnt = count($msg->entities);
if ($init !==false) {
$iEntSub = $i+1;
if ($msg->parent->type0 == 'message' &&
$msg->parent->type1 == 'rfc822' &&
$msg->type0 == 'multipart') {
$iEntSub = '0';
}
if ($init) {
$msg->entity_id = "$init.$iEntSub";
} else {
$msg->entity_id = $iEntSub;
}
} else if ($iCnt) {
$msg->entity_id='0';
} else {
$msg->entity_id='1';
}
for ($i=0;$i<$iCnt;++$i) {
$msg->entities[$i]->parent =& $msg;
if (strrchr($msg->entity_id, '.') != '.0') {
$msg->entities[$i]->setEntIds($msg->entities[$i],$msg->entity_id,$i);
} else {
$msg->entities[$i]->setEntIds($msg->entities[$i],$msg->parent->entity_id,$i);
}

}
}

function parseBodyStructure($read, &$i, $sub_msg = '') {
$arg_no = 0;
$arg_a = array();
if ($sub_msg) {
$message = $sub_msg;
} else {
$message = new Message();
}
$this = $message;
for ($cnt = strlen($read); $i < $cnt; ++$i) {
$char = strtoupper($read{$i});
switch ($char) {
case '(':
switch($arg_no) {
case 0:
if (!isset($msg)) {
$msg = new Message();
$hdr = new MessageHeader();
$hdr->type0 = 'text';
$hdr->type1 = 'plain';
$hdr->encoding = 'us-ascii';
} else {
$msg->header->type0 = 'multipart';
$msg->type0 = 'multipart';
while ($read{$i} == '(') {
$msg->addEntity($this->parseBodyStructure($read, $i, $msg));
}
}
break;
case 1:
/* multipart properties */
++$i;
$arg_a[] = $this->parseProperties($read, $i);
++$arg_no;
break;
case 2:
if (isset($msg->type0) && ($msg->type0 == 'multipart')) {
++$i;
$arg_a[] = $this->parseDisposition($read, $i);
} else { /* properties */
$arg_a[] = $this->parseProperties($read, $i);
}
++$arg_no;
break;
case 3:
if (isset($msg->type0) && ($msg->type0 == 'multipart')) {
++$i;
$arg_a[]= $this->parseLanguage($read, $i);
}
case 7:
if (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822')) {
$msg->header->type0 = $arg_a[0];
$msg->header->type1 = $arg_a[1];
$msg->type0 = $arg_a[0];
$msg->type1 = $arg_a[1];
$rfc822_hdr = new Rfc822Header();
$msg->rfc822_header = $this->parseEnvelope($read, $i, $rfc822_hdr);
while (($i < $cnt) && ($read{$i} != '(')) {
++$i;
}
$msg->addEntity($this->parseBodyStructure($read, $i,$msg));
}
break;
case 8:
++$i;
$arg_a[] = $this->parseDisposition($read, $i);
++$arg_no;
break;
case 9:
++$i;
if (($arg_a[0] == 'text') || (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822'))) {
$arg_a[] = $this->parseDisposition($read, $i);
} else {
$arg_a[] = $this->parseLanguage($read, $i);
}
++$arg_no;
break;
case 10:
if (($arg_a[0] == 'text') || (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822'))) {
++$i;
$arg_a[] = $this->parseLanguage($read, $i);
} else {
$i = $this->parseParenthesis($read, $i);
$arg_a[] = ''; /* not yet described in rfc2060 */
}
++$arg_no;
break;
default:
/* unknown argument, skip this part */
$i = $this->parseParenthesis($read, $i);
$arg_a[] = '';
++$arg_no;
break;
} /* switch */
break;
case '"':
/* inside an entity -> start processing */
$arg_s = $this->parseQuote($read, $i);
++$arg_no;
if ($arg_no < 3) {
$arg_s = strtolower($arg_s); /* type0 and type1 */
}
$arg_a[] = $arg_s;
break;
case 'n':
case 'N':
/* probably NIL argument */
$tmpnil = strtoupper(substr($read, $i, 4));
if ($tmpnil == 'NIL ' || $tmpnil == 'NIL)') {
$arg_a[] = '';
++$arg_no;
$i += 2;
}
break;
case '{':
/* process the literal value */
$arg_s = $this->parseLiteral($read, $i);
++$arg_no;
break;
case '0':
case is_numeric($read{$i}):
/* process integers */
if ($read{$i} == ' ') { break; }
++$arg_no;
if (preg_match('/^([0-9]+).*/',substr($read,$i), $regs)) {
$i += strlen($regs[1])-1;
$arg_a[] = $regs[1];
} else {
$arg_a[] = 0;
}
break;
case ')':
$multipart = (isset($msg->type0) && ($msg->type0 == 'multipart'));
if (!$multipart) {
$shifted_args = (($arg_a[0] == 'text') || (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822')));
$hdr->type0 = $arg_a[0];
$hdr->type1 = $arg_a[1];

$msg->type0 = $arg_a[0];
$msg->type1 = $arg_a[1];
$arr = $arg_a[2];
if (is_array($arr)) {
$hdr->parameters = $arg_a[2];
}
$hdr->id = str_replace('<', '', str_replace('>', '', $arg_a[3]));
$hdr->description = $arg_a[4];
$hdr->encoding = strtolower($arg_a[5]);
$hdr->entity_id = $msg->entity_id;
$hdr->size = $arg_a[6];
if ($shifted_args) {
$hdr->lines = $arg_a[7];
$s = 1;
} else {
$s = 0;
}
$hdr->md5 = (isset($arg_a[7+$s]) ? $arg_a[7+$s] : $hdr->md5);
$hdr->disposition = (isset($arg_a[8+$s]) ? $arg_a[8+$s] : $hdr->disposition);
$hdr->language = (isset($arg_a[9+$s]) ? $arg_a[9+$s] : $hdr->language);
$msg->header = $hdr;
} else {
$hdr->type0 = 'multipart';
$hdr->type1 = $arg_a[0];
$msg->type0 = 'multipart';
$msg->type1 = $arg_a[0];
$hdr->parameters = (isset($arg_a[1]) ? $arg_a[1] : $hdr->parameters);
$hdr->disposition = (isset($arg_a[2]) ? $arg_a[2] : $hdr->disposition);
$hdr->language = (isset($arg_a[3]) ? $arg_a[3] : $hdr->language);
$msg->header = $hdr;
}
return $msg;
default: break;
} /* switch */
} /* for */
} /* parsestructure */

function parseProperties($read, &$i) {
$properties = array();
$prop_name = '';

for (; $read{$i} != ')'; ++$i) {
$arg_s = '';
if ($read{$i} == '"') {
$arg_s = $this->parseQuote($read, $i);
} else if ($read{$i} == '{') {
$arg_s = $this->parseLiteral($read, $i);
}

if ($arg_s != '') {
if ($prop_name == '') {
$prop_name = strtolower($arg_s);
$properties[$prop_name] = '';
} else if ($prop_name != '') {
$properties[$prop_name] = $arg_s;
$prop_name = '';
}
}
}
return $properties;
}

function parseEnvelope($read, &$i, $hdr) {
$arg_no = 0;
$arg_a = array();
++$i;
for ($cnt = strlen($read); ($i < $cnt) && ($read{$i} != ')'); ++$i) {
$char = strtoupper($read{$i});
switch ($char) {
case '"':
$arg_a[] = $this->parseQuote($read, $i);
++$arg_no;
break;
case '{':
$arg_a[] = $this->parseLiteral($read, $i);
/* temp bugfix (SM 1.5 will have a working clean version)
too much work to implement that version right now */
// --$i;
++$arg_no;
break;
case 'N':
/* probably NIL argument */
if (strtoupper(substr($read, $i, 3)) == 'NIL') {
$arg_a[] = '';
++$arg_no;
$i += 2;
}
break;
case '(':
/* Address structure (with group support)
* Note: Group support is useless on SMTP connections
* because the protocol doesn't support it
*/
$addr_a = array();
$group = '';
$a=0;
for (; $i < $cnt && $read{$i} != ')'; ++$i) {
if ($read{$i} == '(') {
$addr = $this->parseAddress($read, $i);
if (($addr->host == '') && ($addr->mailbox != '')) {
/* start of group */
$group = $addr->mailbox;
$group_addr = $addr;
$j = $a;
} else if ($group && ($addr->host == '') && ($addr->mailbox == '')) {
/* end group */
if ($a == ($j+1)) { /* no group members */
$group_addr->group = $group;
$group_addr->mailbox = '';
$group_addr->personal = "$group: Undisclosed recipients;";
$addr_a[] = $group_addr;
$group ='';
}
} else {
$addr->group = $group;
$addr_a[] = $addr;
}
++$a;
}
}
$arg_a[] = $addr_a;
break;
default: break;
}
}

if (count($arg_a) > 9) {
$d = strtr($arg_a[0], array(' ' => ' '));
$d = explode(' ', $d);
if (!$arg_a[1]) $arg_1[1] = _("(no subject)");

$hdr->date = getTimeStamp($d); /* argument 1: date */
$hdr->subject = $arg_a[1]; /* argument 2: subject */
$hdr->from = is_array($arg_a[2]) ? $arg_a[2][0] : ''; /* argument 3: from */
$hdr->sender = is_array($arg_a[3]) ? $arg_a[3][0] : ''; /* argument 4: sender */
$hdr->replyto = is_array($arg_a[4]) ? $arg_a[4][0] : ''; /* argument 5: reply-to */
$hdr->to = $arg_a[5]; /* argument 6: to */
$hdr->cc = $arg_a[6]; /* argument 7: cc */
$hdr->bcc = $arg_a[7]; /* argument 8: bcc */
$hdr->inreplyto = $arg_a[8]; /* argument 9: in-reply-to */
$hdr->message_id = $arg_a[9]; /* argument 10: message-id */
}
return $hdr;
}

function parseLiteral($read, &$i) {
$lit_cnt = '';
++$i;
$iPos = strpos($read,'}',$i);
if ($iPos) {
$lit_cnt = substr($read, $i, $iPos - $i);
$i += strlen($lit_cnt) + 3; /* skip } + \r + \n */
/* Now read the literal */
$s = ($lit_cnt ? substr($read,$i,$lit_cnt): '');
$i += $lit_cnt;
/* temp bugfix (SM 1.5 will have a working clean version)
too much work to implement that version right now */
--$i;
} else { /* should never happen */
$i += 3; /* } + \r + \n */
$s = '';
}
return $s;
}

function parseQuote($read, &$i) {
$s = '';
$iPos = ++$i;
while (true) {
$iPos = strpos($read,'"',$iPos);
if (!$iPos) break;
if ($iPos && $read{$iPos -1} != '\\') {
$s = substr($read,$i,($iPos-$i));
$i = $iPos;
break;
}
$iPos++;
if ($iPos > strlen($read)) {
break;
}
}
return $s;
}

function parseAddress($read, &$i) {
$arg_a = array();
for (; $read{$i} != ')'; ++$i) {
$char = strtoupper($read{$i});
switch ($char) {
case '"': $arg_a[] = $this->parseQuote($read, $i); break;
case '{': $arg_a[] = $this->parseLiteral($read, $i); break;
case 'n':
case 'N':
if (strtoupper(substr($read, $i, 3)) == 'NIL') {
$arg_a[] = '';
$i += 2;
}
break;
default: break;
}
}

if (count($arg_a) == 4) {
$adr = new AddressStructure();
$adr->personal = $arg_a[0];
$adr->adl = $arg_a[1];
$adr->mailbox = $arg_a[2];
$adr->host = $arg_a[3];
} else {
$adr = '';
}
return $adr;
}

function parseDisposition($read, &$i) {
$arg_a = array();
for (; $read{$i} != ')'; ++$i) {
switch ($read{$i}) {
case '"': $arg_a[] = $this->parseQuote($read, $i); break;
case '{': $arg_a[] = $this->parseLiteral($read, $i); break;
case '(': $arg_a[] = $this->parseProperties($read, $i); break;
default: break;
}
}

if (isset($arg_a[0])) {
$disp = new Disposition($arg_a[0]);
if (isset($arg_a[1])) {
$disp->properties = $arg_a[1];
}
}

return (is_object($disp) ? $disp : '');
}

function parseLanguage($read, &$i) {
/* no idea how to process this one without examples */
$arg_a = array();

for (; $read{$i} != ')'; ++$i) {
switch ($read{$i}) {
case '"': $arg_a[] = $this->parseQuote($read, $i); break;
case '{': $arg_a[] = $this->parseLiteral($read, $i); break;
case '(': $arg_a[] = $this->parseProperties($read, $i); break;
default: break;
}
}

if (isset($arg_a[0])) {
$lang = new Language($arg_a[0]);
if (isset($arg_a[1])) {
$lang->properties = $arg_a[1];
}
}

return (is_object($lang) ? $lang : '');
}

function parseParenthesis($read, $i) {
for (; $read{$i} != ')'; ++$i) {
switch ($read{$i}) {
case '"': $this->parseQuote($read, $i); break;
case '{': $this->parseLiteral($read, $i); break;
case '(': $this->parseProperties($read, $i); break;
default: break;
}
}
return $i;
}

<?php

/**
* Message.class.php
*
* Copyright (c) 2003 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This contains functions needed to handle mime messages.
*
* $Id: Message.class.php,v 1.17 2003/03/27 16:16:48 jangliss Exp $
*/

class Message {
/** message is the object that contains messages. It is a recursive
object in that through the $entities variable, it can contain
more objects of type message. See documentation in mime.txt for
a better description of how this works.
**/
var $rfc822_header = '',
$mime_header = '',
$flags = '',
$type0='',
$type1='',
$entities = array(),
$entity_id = '',
$parent_ent, $entity,
$parent = '', $decoded_body='',
$is_seen = 0, $is_answered = 0, $is_deleted = 0, $is_flagged = 0,
$is_mdnsent = 0,
$body_part = '',
$offset = 0, /* for fetching body parts out of raw messages */
$length = 0, /* for fetching body parts out of raw messages */
$att_local_name = ''; /* location where the tempory attachment
is stored. For future usage in smtp.php */

function setEnt($ent) {
$this->entity_id= $ent;
}


TIA
 
Old 06-05-2008, 03:19 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
RH9 is pretty old, which may cause you problems.

What version of php do you have? SM requires at least 4.1.0.
 
Old 06-05-2008, 06:09 AM   #5
taruvinga
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Original Poster
Blog Entries: 1

Rep: Reputation: 0
I understand RH9 has been around for a while. I am using PHP 5.0.4 and mysql Ver 14.7 Distrib 4.1.11
 
Old 07-25-2008, 05:58 PM   #6
sr123
LQ Newbie
 
Registered: Jul 2008
Posts: 1

Rep: Reputation: 0
Did you ever resolve this problem? I am getting exactly the same thing.

Funny thing is, it was working fine prior to me moving the webserver to another node (I basically upgraded the machine).

I changed absolutely nothing as far as the squirrelmail config goes. Everything else in my upgrade works! I migrated about 8 domains to a new server running Fedora 9 and the latest versions of both Apache and PHP. The last thing I expected to break was the webmail....

The error I'm getting after I login is:

Cannot re-assign $this Message.class.php on line 183

I have tried re-running conf.pl but that's not resolving the problem.

Any help would be greatly appreciated.

sr123
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squirrelmail is not showing interface... taruvinga Linux - Newbie 0 06-03-2008 11:03 AM
Wireless Card seems to be loaded but is not showing interface stu_mueller Slackware 3 06-09-2007 07:28 AM
how can i shutdown the PHYSICAL interface of an ethernet interface markraem Linux - Networking 2 04-12-2007 02:29 PM
Squirrelmail not showing received emails. nayyares Linux - General 1 01-04-2007 10:33 AM
WPA support through 'ndiswrapper' interface is deprecated; use 'wext' interface lavie Linux - Wireless Networking 1 12-04-2006 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration