|Subject:||Re: BCC is send with the headers after LoadFromFile|
|Posted by:||Remy Lebeau (Indy Team) (email@example.com)|
|Date:||Fri, 8 Sep 2006|
"Alex Ivlev" <firstname.lastname@example.org> wrote in message
> BCC is the one header that's not supposed to be sent out with the message.
Correct, and it is not.
> And normally that works fine: procedure TIdMessage.GenerateHeader
> does not generate a header line for BCC. Except one case - when the
> message is saved to file then BCC is saved with it.
As it should be. Otherwise the header would be lost when the message is
loaded from the file.
> But when it's loaded back, procedure TIdMessage.LoadFromStream
> forgets to remove that line.
It does not "forget". It is not supposed to remove it in the first place.
> Here is a fix for this situation (the 1 added line is marked):
A better fix would be to have TIdMessageClient.SendMsg() omit BCC when
sending the Headers property over the connection. BCC should not be removed
from the Headers property itself. SendMsg() could instead call SendHeader()
instead of IOHandler.Write(Headers). Or at least copy the Headers to a
temporary TStringList, remove the BCC value, and then send the temporary
instead of the Headers directly.
Bug: BCC is send with the headers after LoadFromFile posted by Alex Ivlev on Fri, 8 Sep 2006