Re: Change subject in tidmessage without re-encoding the whole message?

Giganews Newsgroups
Subject: Re: Change subject in tidmessage without re-encoding the whole message?
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Tue, 10 Jan 2006

"arthur hoornweg" <antispam.hoornweg@casema.nl.net> wrote in message
news:FE394162E8E8E240antispam.hoornweg@casema.nl.net...

> is it possible to change the "subject" of a tidmessage
> without having Indy re-encode the whole message?

The only way to preserve the original content of the message without any
modification at all is to set both the NoDecode and NoEncode properties to
true.  This will store the raw data as-is in the TIdMessage.Body property.
There will be no parsing or encoding of the data at all.

> I intend to use this in a spam filter that analyzes mails

That makes the issue a bit more complex.  If you want to analyze the data
parsed, then you can't use the NoDecode/NoEncode properties.

> Many spam mails are improperly encoded and I don't want
> Indy to change anything about the encoding.

Then you have have to use the NoDecode/NoEncode properties and parse the raw
data manually.

Gambit

Replies

In response to

Change subject in tidmessage without re-encoding the whole message? posted by arthur hoornweg on Tue, 10 Jan 2006