Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: Displaying forwarded rfc822 message Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
pityu
Newbie
Newbie


Joined: 27 September 2009
Online Status: Offline
Posts: 2
Posted: 27 September 2009 at 8:20am | IP Logged Quote pityu

Some mail server are sending the forwarded mails as Content-type: message/rfc822 attachments (ie. CommuniGate Pro).

AL Webmail shows them as attachments without any file extension. User can download the file, but can't read it on web interface. To fix this "bug" you may change some lines (in this example AL Webmail Lite PHP).

base-iframe.php #459:
Code:
else if (substr($_tfilename, -4) == '.eml')
change to:
Code:
else if (substr($_tfilename, -4) == '.eml' || $_tfilename == 'message.rfc822')


message-wiev.php #281:
Code:
else if (substr($_tfilename, -4) == '.eml' || $_tfilename == 'message.rfc822')
change to:
Code:
if ($lowerAttachFileName == 'winmail.dat' || substr($lowerAttachFileName, -4) == '.eml' || $lowerAttachFileName == 'message.rfc822')
and enter after #288:
Code:
else if (false !== strpos($contentType, 'message/rfc822'))
{
$view =  'message-view.php?type='.MESSAGE_VIEW_TYPE_ATTACH.'&tn='.url encode($tempName);
}


/mime/class_attachment.php #74:
Code:

           function GetFilenameFromMime()

           {

                $filename  = $this->MimePart->GetFilename();

                $result  = '';

                if  ($filename === '')

                 {

                      $contentName = $this->MimePart->GetContentTypeName();

                      if  ($contentName)

                      {

                           $result  = $contentName;

                      }

                      else

                      {

                           $contentType  = strtolower($this->GetContentType());

                           $result  = (strpos($contentType, 'image') !== false || strpos($contentType, 'message') !== false)

                                            ? str_replace(array('/', '\\'), '.', $contentType)

                                            : 'no_name_attachment.tmp';

                      }

                }  

                else  

                 {

                      $result  = $filename;

                }

                return  $result;

           }

change to:
Code:
           function GetFilenameFromMime()

           {

                $filename  = $this->MimePart->GetFilename();

                $result  = '';

                if  ($filename === '')

                 {

                      $contentName = $this->MimePart->GetContentTypeName();

                      if  ($contentName)

                      {

                           $result  = $contentName;

                      }

                      else

                      {

                           $contentType  = strtolower($this->GetContentType());

                           $result  = (strpos($contentType, 'image') !== false || strpos($contentType, 'message') !== false)

                                            ? str_replace(array('/', '\\'), '.', $contentType)

                                            : 'no_name_attachment.tmp';

                      }

if ($result == 'message.rfc822') $result = $result.'.eml';
                }  

                else  

                 {


if ($filename == 'message.rfc822') $filename = $filename.'.eml';

                      $result  = $filename;

                }

                return  $result;

           }


I hope it helps someone.
Back to Top View pityu's Profile Search for other posts by pityu
 
pityu
Newbie
Newbie


Joined: 27 September 2009
Online Status: Offline
Posts: 2
Posted: 27 September 2009 at 8:36am | IP Logged Quote pityu

I'm sorry it's a mistake above:

Of course this is what you have to change in message-wiev.php at #281:
Code:

if ($lowerAttachFileName == 'winmail.dat' || substr($lowerAttachFileName, -4) == '.eml')

Back to Top View pityu's Profile Search for other posts by pityu
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 28 September 2009 at 4:08am | IP Logged Quote Andrew

Thanks. We appreciate your collaboration.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide