Author |
|
pityu Newbie
Joined: 27 September 2009
Online Status: Offline Posts: 2
|
Posted: 27 September 2009 at 8:20am | IP Logged
|
|
|
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 |
|
|
pityu Newbie
Joined: 27 September 2009
Online Status: Offline Posts: 2
|
Posted: 27 September 2009 at 8:36am | IP Logged
|
|
|
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 |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 28 September 2009 at 4:08am | IP Logged
|
|
|
Thanks. We appreciate your collaboration.
Best regards,
Andrew
|
Back to Top |
|
|