Header

Syntax

header [COMPARATOR] [MATCH-TYPE] <header-names: string-list> <key-list: string-list>

Description

The "header" test evaluates to true if any header name matches any key. The type of match is specified by the optional match argument, which defaults to ":is" if not specified. Like address and envelope, this test returns true if any combination of the string-list and key-list arguments match. If a header listed in the header-names argument exists, it contains the null key (""). However, if the named header is not present, it does not contain the null key. So if a message contained the header

X-Caffeine: C8H10N4O2

these tests on that header evaluate as follows:

header :is ["X-Caffeine"] [""] -- evaluates to false
header :contains ["X-Caffeine"] [""] -- evaluates to true

Module

Core : Requires no import statement

Resources

RFC3028