[Mimedefang] Testing for the existence of a header
Leonard Mills
lenm at ops.corpnet.sel.sony.com
Tue Sep 30 21:15:07 EDT 2008
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 :(
>
> Rgds
>
> Nigel.
>
> _______________________________________________
> NOTE: If there is a disclaimer or other legal boilerplate in the above
> message, it is NULL AND VOID. You may ignore it.
>
> Visit http://www.mimedefang.org and http://www.roaringpenguin.com
> MIMEDefang mailing list MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>
>
More information about the MIMEDefang
mailing list