ietf-mta-filters
[Top] [All Lists]

Re: Should the exists header match a header with no "content"

2001-04-18 06:08:16
What exactly does it mean for a header to exist in an email?

It means the field label is present among the lines of the header. It doesn't
mean there is any content associated with the label.

If the name of
the header exists, but the content is blank does this header exist or not?

It does.

ie suppose I have a script:
  if not exists "From" {
      discard;
  }

Then obviously it should discard:

   Date: Tue, 1 Apr 1997 09:06:31 -0800 (PST)
   To: roadrunner(_at_)acme(_dot_)example(_dot_)com
   Subject: I have a present for you

   Look, I'm sorry about the whole anvil thing, and I really
   ....
   great birdseed over here at my place--top of the line

and not discard:

   Date: Tue, 1 Apr 1997 09:06:31 -0800 (PST)
   From: coyote(_at_)desert(_dot_)example(_dot_)org
   To: roadrunner(_at_)acme(_dot_)example(_dot_)com
   Subject: I have a present for you

   Look, I'm sorry about the whole anvil thing, and I really
   ....
   great birdseed over here at my place--top of the line

but should this discard the following message?

   Date: Tue, 1 Apr 1997 09:06:31 -0800 (PST)
   From:
   To: roadrunner(_at_)acme(_dot_)example(_dot_)com
   Subject: I have a present for you

   Look, I'm sorry about the whole anvil thing, and I really
   ....
   great birdseed over here at my place--top of the line

It should not discard this message.

I know I could change my exists test code to catch "empty" headers, but does
anyone know if there are any headers in existence that may legitimately not
contain any "data".

The obvious example is bcc -- a message has to have one or more recipient
header fields, but if you don't want to list any recipients you're allowed to
use an empty bcc.

There are also some nonstandard return receipt fields in use that where present
but empty has different semantics than absent.

More generally, given that new headers can be added at any time, it is always
possible for new fields to be defined that assign unique semantics to present
but empty.

                                Ned

<Prev in Thread] Current Thread [Next in Thread>