Re: dMessage and FExtraHeaders

Giganews Newsgroups
Subject: Re: dMessage and FExtraHeaders
Posted by:  hm_aapje (cyber…@zeelandnet.nl)
Date: Sun, 21 Jun 2009

I've changed one line of code in TIdMessage to support this, it would be nice if this solution (or made by you guys ofc) could make it into indy, since header-duplicates are useless ofc :)

I've changed:

    // Add extra headers created by UA - allows duplicates
    if (FExtraHeaders.Count > 0) then begin
      AddStrings(FExtraHeaders);
    end;

to

    // Add extra headers created by UA - doesn't allow duplicates
    if (FExtraHeaders.Count > 0) then begin
      for i:= 0 to FExtraHeaders.Count -1 do
        Values[ FExtraHeaders.Names[i] ]:= FExtraHeaders.ValueFromIndex[i];
    end;

Cheers

> Hi,
>
> Is it possible to add extra headers using FExtraHeaders but let them replace
>  headers that already exist?
> For example, I want to change the To-header, so I add that header to FExtraH
> eaders but that makes the headerlist to have 2 to-headers instead of one (th
> e header from FExtraHeaders replacing the old one).
>
> I think this should be done for every header to avoid doubles.
>
> Thnx.
>
> P.S. are the forums still being used since there is a lot of spam :(

Replies

In response to

dMessage and FExtraHeaders posted by hm_aapje on Sun, 21 Jun 2009