Mime encoding gone wrong..

Giganews Newsgroups
Subject: Mime encoding gone wrong..
Posted by:  sFoster (pongsh…@gmail.com)
Date: Tue, 10 Apr 2007

Hi,

Just to get the formalities out of the way, I am using Delphi 2006 and indy
10.1.1

Anyway, I have been working hard at it but my problem is this..
After calling  idpop31.Retrieve(j, idMessage1) all of the headers (e.g.
from) are blank and the body contains what appears to be most of a raw
retrieve.
I believe the problem is because my TIdMessage contains a blank line in the
header data, and the following mime code is being interpreted as the
preamble.

The output is listed below for reference.

Is there anything I can do other than try to parse this manually?
I had one thought of turning off the decoding before I retrieve the message,
and then removing any blank lines that appear between mime statements.

Turn back on the encoding and theoretically I should have a working message,
but I'm not sure how scalable this approach is.
Also this message format may be corrupted to begin with because of me (not
that it's really the point, it's here and now I have to deal with it..)

I am sending the message through a black box, which is routed to my friend.
My friend then replies to the black box which is sent back to me.

Any help is really appreciated!
Thanks,
- Sean

Code for reference:
------------------------------------------
[***This is TIdMessage.body***]
          Tue, 10 Apr 2007 11:41:11 -0700 (PDT)
Message-ID: <adfas…@adfa.dfdt>
From: adfas…@adfa.dfdt
To: adfas…@adfa.dfdt
Subject: RE:
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Date: Tue, 10 Apr 2007 11:41:11 -0700 (PDT)

text of message sent in reply
------------------
ads…@gmail.com /text of first message sent
[/***This is TIdMessage.body***]

[***This is the output of idMessage1.SaveToFile('myFile.txt', false)***]
Delivered-To: someanonad…@gmail.com
Received: by 10.66.219.15 with SMTP id r15cs116903ugg;
        Tue, 10 Apr 2007 11:41:15 -0700 (PDT)
Received: by 10.115.18.1 with SMTP id v1mr2901403wai.1176230474762;
        Tue, 10 Apr 2007 11:41:14 -0700 (PDT)
Return-Path: <adfas…@adfa.dfdt>
Received: from mailx04.here.net (mailx04.here.net [66.94.9.234])
        by mx.google.com with ESMTP id q18si1730311pog.2007.04.10.11.41.14;
        Tue, 10 Apr 2007 11:41:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of adfa@.adfadf designates
66.94.9.234 as permitted sender)
Received: from promd02 (11.35.176.10.in-addr.arpa [10.176.35.11])
by mailx04.tmomail.net (8.12.11.20060308/8.12.11) with ESMTP id
l3AIfXfl028987
for <adfas…@adfa.dfdt>; Tue, 10 Apr 2007 11:41:33 -0700
Received: from null ([10.176.35.75])
          by MD2 SMTP SERVER (Message Director SMTP Server v2.36) with SMTP
ID 745
          for <adfas…@adfa.dfdt>;
Content-Type: text/plain
Date: Tue, 10 Apr 2007 14:41:41 +0000

          Tue, 10 Apr 2007 11:41:11 -0700 (PDT)
Message-ID: <adfas…@adfa.dfdt>
From: adfas…@adfa.dfdt
To: adfas…@adfa.dfdt
Subject: RE:
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Date: Tue, 10 Apr 2007 11:41:11 -0700 (PDT)

text of message sent in reply
------------------
ads…@gmail.com /text of first message sent
..
[***/This is the output of TidMessage1.SaveToFile('myFile.txt', false)***]

Replies