 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
marlon b Guest
|
Posted: Thu Dec 15, 2005 3:46 pm Post subject: Synapse failed to open message inside message |
|
|
hi,
I cannot open this message using synapse, using mimedemo
save decoded part produce empty file.
Decodepart;
Decodedlines.SaveToFile(f); //empty file
I think it's a bug in TMimePart.DecodePart, because
all my message with a message inside, failed to
open by Synapse.
The same message can be opened and saved by Outlook Express.
You can try it, with any message with message within.
PS: Windows 2k, Delphi5, Synapse r36, bellow is sample message i use.
From: "Annie Kutnesova" <annie (AT) easy (DOT) com>
To: "pamela anderson,jahana" <pamela (AT) easy (DOT) com>
Subject: this is outer message
Date: Wed, 14 Dec 2005 21:36:00 +0700
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0013_01C600F6.63263140"
X-Priority: 3
X-MSMail-Priority: Normal
X-Unsent: 1
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
This is a multi-part message in MIME format.
------=_NextPart_000_0013_01C600F6.63263140
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: base64
DQppbnNpZGUgb3V0ZXIgbWVzc2FnZQ==
------=_NextPart_000_0013_01C600F6.63263140
Content-Type: message/rfc822;
name="inner.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="inner.eml"
From: "Annie Kutnesova" <annie (AT) easy (DOT) com>
To: "toni" <toni (AT) easy (DOT) com>
Subject: this is inner message
Date: Wed, 14 Dec 2005 21:35:22 +0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: base64
X-Priority: 3
X-MSMail-Priority: Normal
X-Unsent: 1
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
DQppbnNpZGUgaW5uZXIgbWVzc2FnZQ==
------=_NextPart_000_0013_01C600F6.63263140--
--
regards,
marlon b
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
|
|
| Back to top |
|
 |
theo Guest
|
Posted: Thu Dec 15, 2005 4:36 pm Post subject: Re: Synapse failed to open message inside message |
|
|
marlon b schrieb:
| Quote: |
hi,
I cannot open this message using synapse, using mimedemo
save decoded part produce empty file.
Decodepart;
Decodedlines.SaveToFile(f); //empty file
I think it's a bug in TMimePart.DecodePart, because
all my message with a message inside, failed to
open by Synapse.
|
http://sourceforge.net/mailarchive/message.php?msg_id=11926304
|
|
| Back to top |
|
 |
marlon b Guest
|
Posted: Fri Dec 16, 2005 6:53 pm Post subject: Re: Synapse failed to open message inside message |
|
|
On Thu, 15 Dec 2005 23:36:21 +0700, theo <nospam (AT) for (DOT) me> wrote:
| Quote: | marlon b schrieb:
hi,
I cannot open this message using synapse, using mimedemo
save decoded part produce empty file.
Decodepart;
Decodedlines.SaveToFile(f); //empty file
I think it's a bug in TMimePart.DecodePart, because
all my message with a message inside, failed to
open by Synapse.
http://sourceforge.net/mailarchive/message.php?msg_id=11926304
|
could you give me a sample code how to do this ?
tia
marlon b
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
|
|
| Back to top |
|
 |
marlon b Guest
|
Posted: Fri Dec 16, 2005 6:56 pm Post subject: Re: Synapse failed to open message inside message |
|
|
On Thu, 15 Dec 2005 23:36:21 +0700, theo <nospam (AT) for (DOT) me> wrote:
| Quote: | marlon b schrieb:
hi,
I cannot open this message using synapse, using mimedemo
save decoded part produce empty file.
Decodepart;
Decodedlines.SaveToFile(f); //empty file
I think it's a bug in TMimePart.DecodePart, because
all my message with a message inside, failed to
open by Synapse.
http://sourceforge.net/mailarchive/message.php?msg_id=11926304
|
could you give aample code how to do this ?
tia
marlon b
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
|
|
| Back to top |
|
 |
theo Guest
|
Posted: Sat Dec 17, 2005 1:13 am Post subject: Re: Synapse failed to open message inside message |
|
|
| Quote: |
could you give aample code how to do this ?
|
I've once written such a thing. I show you a code snippet here, without
all var declarations and the full context. For me it works, but there
may be better ways.
From you main Mime Object, call _DecodePart somewhat like this
----------------
Mime := TMimeMess.create;
try
Mime.Lines.Assign(Pop.FullResult);
Pop.FullResult.Clear;
try
Mime.DecodeMessage;
except
....
end;
Blah blah......
try
_DecodePart(Mime.MessagePart); //Recursive Decoding
except
...
end;
---------------
procedure _DecodePart(Part: TMimePart);
var i: integer;
S, Fn: string;
PP, PS: string;
begin
Part.DecomposeParts; //decode subparts
Part.DecodePart;
PP := UpperCase(Part.Primary);
PS := UpperCase(Part.Secondary);
{ writeln('************** ', Part.SubLevel, Part.Primary + '/' +
Part.Secondary + ' ' + Part.FileName + ' ' + Part.Description + ' ' +
Part.ContentID); }
if PP <> 'MULTIPART' then //If Multipart, go next level
begin
Part.DecodedLines.Seek(0, soFromBeginning);
if PP = 'TEXT' then
begin
if (PS = 'PLAIN') then
begin
SetLength(S, Part.DecodedLines.Size);
Part.DecodedLines.Read(S[1], Length(S));
PlainTxt.Add(S);
end;
if (PS = 'HTML') then
begin
SetLength(S, Part.DecodedLines.Size);
Part.DecodedLines.Read(S[1], Length(S));
PlainTxt.Add(RemoveHTMLTags(S));
end;
end else
begin
if Part.FileName <> '' then
begin
Fn := SavePath + Part.Filename;
Part.DecodedLines.SaveToFile(Fn);
end;
end;
end;
for i := 0 to Part.GetSubPartCount - 1 do
begin
_DecodePart(Part.GetSubPart(i)); //Recursive call
end;
end;
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|