tidMessage MIME problems...

Giganews Newsgroups
Subject: tidMessage MIME problems...
Posted by:  arthur hoornweg (arthur.hoornw…@wanadoo.nl.net)
Date: Thu, 18 Mar 2004

Hello all,

(I'm using indy 9, latest developer snapshot)

I have the huge problem that "tidmessage.savetofile"
saves  multi-part mime messages with the wrong "boundary"
in the header. It is a terrible p.i.t.a. because almost
all mails that I load and subsequently save with this
component become mutilated. The body is then displayed as
a blank body in every e-mail client I've tried so far.

A basic load/save operation is sufficient to demonstrate
the problem:

VAR msg: tidmessage;
begin
    ....
    msg.loadfromfile(filename1,false); //load mail
    msg.savetofile  (filename2,false); //save mail

I have applied and tested the various patches described in
these forums but unfortunately they don't work reliably.

I have taken *desperate* measures to circumvent the
problem because I have a deadline that expires today.
(I was ordered to implement a spam filter in our
company's mail server)

in Unit idmessagecodermime:  change the default MIME boundary
constants into writeable strings:

const
  IndyMIMEBoundary :string=.....
  IndyMultiPartAlternativeBoundary  :string= .....
    IndyMultiPartRelatedBoundary      :string= .......

Now evaluate the original Mime boundary in a mail message
by loading only the header:

  msg.LoadFromFile(filename1, true);  //Read only header
  Mymimeboundary:=msg.Mimeboundary.boundary;
  if Mymimeboundary <>'' then
  begin
    IndyMIMEBoundary                  :=Mymimeboundary;
    IndyMultiPartAlternativeBoundary  :=Mymimeboundary;
    IndyMultiPartRelatedBoundary      :=Mymimeboundary;
  end;

  //Now read and write the whole e-mail file the way you're
  //used to. The header will contain the correct mime boundary
  //because I've just changed Indy's defaults.

I realize that this is a terrible "solution", changing a global
variable in a component suite that's designed to be multi-
threaded, but I am really *desperate* to get the thing working.

Can a bugfixed idMessage/idMessagecodermime be expected any time
soon?

regards,

Arthur Hoornweg
(please remove the ".net" from my e-mail address)

Replies