Empty Headers

Feb 20, 2009 at 5:31 PM
Edited Feb 20, 2009 at 5:39 PM
There are cases where the existence of a header is an idicator in itself, even if it has no value.  You are not adding these headers to the header collection of the message.  Was that intended?

One example is for Microsoft Exchange journaled messages.  Once journaled, they contain a header called "X-MS-Journal-Report".  It has no value.  It exists as a flag to indicate that this message was created as an Exchange journal message.

Just wanted to throw that out ot you.  I've adjusted the code on my end, as I need to see that header.

Also, why are you forcing all headers ToLower() ?

J
Coordinator
Feb 21, 2009 at 8:00 AM
Can you email me an example of a valid message with the journal report header? I'll fix this.

The headers are lower cased to simplify the string comparison and hash table lookup. I could of course make a case insensitive hash table and have the string comparisons case insensitive, but that didn't seem to be worth it because making them lower case doesn't change the content of the email. I had a case where the same header were repeated with different casing, and that made it appear twice in the hash table.


Feb 21, 2009 at 4:54 PM
Edited Feb 21, 2009 at 5:27 PM
There are times when a header can appear more than once. The Received header, comes to mind. You'll get one of those for each server the message passes through. An example of that is attached, as well.

Attached:

  • bcc.eml - A simple Exchange journal message. Has the Empty X-MS-Journal-Message flag as a header. (I made a simple change in the code to just add a space as a value for a header with no value.)
  • External.eml - Sample of a message with multiple received headers.

(I guess the attachments don't stick when replying...  How can I get them to you?)

Jerry

Coordinator
Mar 28, 2009 at 5:47 AM
Hi, I finally got around to testing this, and as far as I can see the
multiple Received headers are handled correctly. the MailMessage class
concatenates the values of several similar headers and on .send() it
separates them into several lines. See attached file for raw output.

With kind regards

Snorre

On Sat, Feb 21, 2009 at 6:54 PM, [email removed] wrote:
> From: rlrcstr
>
> There are times when a header can appear more than once. The Received
> header, comes to mind. You'll get one of those for each server the message
> passes through. An example of that is attached, as well.
> Attached:
> bcc.eml - A simple Exchange journal message. Has the Empty
> X-MS-Journal-Message flag as a header. (I made a simple change in the code
> to just add a space as a value for a header with no value.)
> External.eml - Sample of a message with multiple received headers.
> From: snarum
> Sent: Saturday, February 21, 2009 4:00 AM
> To: [email removed]
> Subject: Re: Empty Headers [mimeParser:48030]
>
> From: snarum
>
> Can you email me an example of a valid message with the journal report
> header? I'll fix this.
>
> The headers are lower cased to simplify the string comparison and hash table
> lookup. I could of course make a case insensitive hash table and have the
> string comparisons case insensitive, but that didn't seem to be worth it
> because making them lower case doesn't change the content of the email. I
> had a case where the same header were repeated with different casing, and
> that made it appear twice in the hash table.
>
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed])
>
> To start a new discussion for this project, email
> [email removed]
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe or change your settings on codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at codeplex.com