BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Synapse failed to open message inside message

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
marlon b
Guest





PostPosted: Thu Dec 15, 2005 3:46 pm    Post subject: Synapse failed to open message inside message Reply with 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.

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





PostPosted: Thu Dec 15, 2005 4:36 pm    Post subject: Re: Synapse failed to open message inside message Reply with quote



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





PostPosted: Fri Dec 16, 2005 6:53 pm    Post subject: Re: Synapse failed to open message inside message Reply with quote



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





PostPosted: Fri Dec 16, 2005 6:56 pm    Post subject: Re: Synapse failed to open message inside message Reply with quote

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





PostPosted: Sat Dec 17, 2005 1:13 am    Post subject: Re: Synapse failed to open message inside message Reply with quote


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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.