Author |
|
arnor Newbie

Joined: 22 August 2007 Location: Taiwan
Online Status: Offline Posts: 35
|
Posted: 26 October 2007 at 3:24pm | IP Logged
|
|
|
webmail php pro can't decode subject like this:
Subject: *SPAM* =?ISO-8859-1?B?UmU6IE1haWxCZWUgc3VwcG9ydCByZXF1ZXN0?=
Because subject does not start with =?, webmail php pro can't decode the subject.
I think you should search =?...?= and replace all =?...?=
Please advise.
|
Back to Top |
|
|
arnor Newbie

Joined: 22 August 2007 Location: Taiwan
Online Status: Offline Posts: 35
|
Posted: 26 October 2007 at 5:02pm | IP Logged
|
|
|
I do some modifications to fix this by myself, but I think andrew may need to recheck it by your way.
Edit class_convertutils.php
Replace 2 functions
1)
function DecodeHeaderString($str, $fromCharset, $toCharset)
{
$bool = false;
$newStr = ConvertUtils::WordExtensionsDecode($str);
$bool = ($newStr != $str);
//$str = str_replace("\r", '', str_replace("\t", '', str_replace("\n", '', str_replace(CRLF, "\n", $newStr))));
$str = str_replace('?= =?', '?==?', $str);
$str = preg_replace('/\s+/',' ', $str);
//$encodeArray = ConvertUtils::SearchEncodedPlaces($str);
$encodeArray = array("\r", $str);
$c = count($encodeArray);
for ($i = 0; $i < $c; $i++)
{
$tempArr = ConvertUtils::DecodeString($encodeArray[$i], $fromCharset, $toCharset);
$str = str_replace($encodeArray[$i], ConvertUtils::ConvertEncoding($tempArr[1], $tempArr[0], $toCharset), $str);
$bool = true;
}
$str = preg_replace('/[;]([a-zA-Z])/', '; $1', $str);
return ($bool) ? $str : ConvertUtils::ConvertEncoding($str, $fromCharset, $toCharset);
}
2)
function DecodeString($str, $fromCharset, $toCharset)
{
$out = array('', $str);
$startpos = strpos($str, '=?');
if ($startpos > 0)
{
$pos = strpos($str, '?', $startpos+2);
$out [0] = substr($str, $startpos+2, $pos - 2 - $startpos);
$encType = strtoupper($str{$pos+1});
$pos2 = strpos($str, '?=', $pos+3);
switch ($encType)
{
case 'Q':
$str = str_replace('_', ' ', $str);
$out [1] = quoted_printable_decode(substr($str, $pos + 3, $pos2-$pos-3));
break;
case 'B':
$out [1] = substr($str, 0, $startpos).base64_decode(substr($str, $pos + 3, $pos2-$pos-3));
break;
}
}
else
{
$pos = strpos($str, '?', 2);
$out [0] = substr($str, 2, $pos - 2);
$encType = strtoupper($str{$pos+1});
switch ($encType)
{
case 'Q':
$str = str_replace('_', ' ', $str);
$out [1] = quoted_printable_decode(substr($str, $pos + 3, strlen($str)-$pos-5));
break;
case 'B':
$out [1] = base64_decode(substr($str, $pos + 3, strlen($str)-$pos-5));
break;
}
}
return $out;
}
|
Back to Top |
|
|
arnor Newbie

Joined: 22 August 2007 Location: Taiwan
Online Status: Offline Posts: 35
|
Posted: 26 October 2007 at 5:04pm | IP Logged
|
|
|
Fix DecodeString() again
function DecodeString($str, $fromCharset, $toCharset)
{
$out = array('', $str);
$startpos = strpos($str, '=?');
if ($startpos > 0)
{
$pos = strpos($str, '?', $startpos+2);
$out [0] = substr($str, $startpos+2, $pos - 2 - $startpos);
$encType = strtoupper($str{$pos+1});
$pos2 = strpos($str, '?=', $pos+3);
switch ($encType)
{
case 'Q':
$str = str_replace('_', ' ', $str);
$out [1] = substr($str, 0, $startpos).quoted_printable_decode(substr($str, $pos + 3, $pos2-$pos-3));
break;
case 'B':
$out [1] = substr($str, 0, $startpos).base64_decode(substr($str, $pos + 3, $pos2-$pos-3));
break;
}
}
else
{
$pos = strpos($str, '?', 2);
$out [0] = substr($str, 2, $pos - 2);
$encType = strtoupper($str{$pos+1});
switch ($encType)
{
case 'Q':
$str = str_replace('_', ' ', $str);
$out [1] = quoted_printable_decode(substr($str, $pos + 3, strlen($str)-$pos-5));
break;
case 'B':
$out [1] = base64_decode(substr($str, $pos + 3, strlen($str)-$pos-5));
break;
}
}
return $out;
}
|
Back to Top |
|
|
Andrew AfterLogic Support

Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 27 October 2007 at 10:43am | IP Logged
|
|
|
Thank you for the fix. We sent you 4 messages on 26 Oct. The update which resolves this issue was included. Have you received our messages?
Best regards,
Andrew
|
Back to Top |
|
|
arnor Newbie

Joined: 22 August 2007 Location: Taiwan
Online Status: Offline Posts: 35
|
Posted: 27 October 2007 at 1:08pm | IP Logged
|
|
|
I didn't get them.
Therefore I did it by myself. :(
Please send those mail to me again.
I would like to use offifical update.
|
Back to Top |
|
|
Andrew AfterLogic Support

Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 29 October 2007 at 12:34am | IP Logged
|
|
|
We've resent the messages. Please let us know if you received them.
If your antispam system supports whitelisting, we recommend you to add our address to the whitelist.
Best regards,
Andrew
|
Back to Top |
|
|
arnor Newbie

Joined: 22 August 2007 Location: Taiwan
Online Status: Offline Posts: 35
|
Posted: 29 October 2007 at 1:40am | IP Logged
|
|
|
Andrew wrote:
We've resent the messages. Please let us know if you received them.
If your antispam system supports whitelisting, we recommend you to add our address to the whitelist.
Best regards,
Andrew |
|
|
I received your mail....BUT
They are just like last time I got your mail with attachment.
The all attachment files (*.EML) are all bad.
1. Can't open with outlook express
2. They are binary format, not MIME.
3. save them to hard drive, they are 1KB only.
I suggest you need to test your support system to send files out :(
|
Back to Top |
|
|
Andrew AfterLogic Support

Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 29 October 2007 at 2:26am | IP Logged
|
|
|
We saved the message which contains attached .eml files which are broken for you, then zipped the message.
Also, we zipped the same message with a password for that case if your mail server re-compresses incoming zip archives.
So once you unzip any of messages, you'll get message.eml which contains attachments:
01.eml
02.eml
03.eml
04.eml
Are these attachments broken too?
Best regards,
Andrew
|
Back to Top |
|
|
rob Groupie

Joined: 03 September 2008 Location: Canada
Online Status: Offline Posts: 60
|
Posted: 09 March 2009 at 8:31am | IP Logged
|
|
|
Hello,
We are also experiencing this issue now with a few emails that have been received. What was the final outcome to resolve this issue? I tried applying the above patches but it actually ended up making the problem worse.
We have also noticed that the remainder of the message is not displayed from the subject forward and it appears to have broken mailbee.
Please help.
Here is a copy of the headers of one of our problematic message:
Subject: =?ISO-8859-1?B?Q2hyZXRpZW4gMTI1NzIxNSAt?=
=?ISO-8859-1?B?IENvbW1pdG1lbnQvQ2xpZW50IENvbW11bmljYXRpb24gV XBkYXRl?=
Date: Mon, 09 Mar 2009 09:55:20 -0400
|
Back to Top |
|
|
rob Groupie

Joined: 03 September 2008 Location: Canada
Online Status: Offline Posts: 60
|
Posted: 09 March 2009 at 8:46am | IP Logged
|
|
|
Just noticed something else here too. After attempting to view the offending message with the above Subject line, mailbee is no longer able to check for new messages against the POP3 server. It continues to say "Cant connect to POP3 server".
Once we reload the whole screen from scratch it starts checking fine again.
|
Back to Top |
|
|
Andrew AfterLogic Support

Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 10 March 2009 at 8:04am | IP Logged
|
|
|
Could you please try to reproduce the issue in AfterLogic WebMail Pro PHP live demo? If you're able to reproduce the issue there, please provide us with the offending message as .EML file for examination. We couldn't reproduce the issue with the subject header you provided.
Best regards,
Andrew
|
Back to Top |
|
|