Leonard Mills | 1 Oct 2008 03:15
Picon

Re: Testing for the existence of a header

I use something like this:

    open (F, "HEADERS") || die "Could not open input file: $:" ;
    while ($line = <F> ) {
        chomp ($line);
        if ( $line =~ /X-SEL-encryption-scan/ ) {
#  do something
        }
    }

Len

On Wed, 1 Oct 2008, Nigel Allen wrote:

> 
> 
> Thanks to David for the last advice - appreciated.
> 
> Can anyone please tell me how to test for the existence of a header in 
> an email?
> 
> Some of the emails that flow through our server have a header - let's 
> call it X-ABC whilst other do not.
> 
> I need to test for the existence of X-ABC before I try to extract the 
> value of it to a variable,
> 
> Googled, searched etc etc - apologies - my perl is only exceeded by my 
> good looks :(
> 
(Continue reading)

Nigel Allen | 1 Oct 2008 03:34
Picon

Re: Testing for the existence of a header


Thanks Len - appreciated.

Of course - once I stopped search for things like "+mimedefang extract 
value x-header" and asked google for "mimedefang headers" I found almost 
exactly the same query posted by someone else (after over an hour of 
searching).

Yesterday was a great day - I think today I should just go back to bed.

Thanks again

Nigel.

On 1/10/2008 11:15 AM, Leonard Mills wrote:
> I use something like this:
>
>     open (F, "HEADERS") || die "Could not open input file: $:" ;
>     while ($line = <F> ) {
>         chomp ($line);
>         if ( $line =~ /X-SEL-encryption-scan/ ) {
> #  do something
>         }
>     }
>
> Len
>
>
>   
(Continue reading)


Gmane