Sendmail Installation and Operation Guide
SMM:08-81
-n not
-f case sensitive
-b
basic regular expressions (default is extended)
-s substring match
-d
set the delimiter used for -s
-a
append string to key
-m match only, do not replace/discard value
-D perform no lookup in deferred delivery mode.
The -s flag can include an optional parameter which can be used to select the sub-
strings in the result of the lookup. For example,
-s1,3,4
Notes: to match a $ in a string, \$$ must be used. If the pattern contains spaces,
they must be replaced with the blank substitution character, unless it is space
itself.
program
The arguments on the K line are the pathname to a program and any initial param-
eters to be passed. When the map is called, the key is added to the initial parame-
ters and the program is invoked as the default user/group id. The first line of stan-
dard output is returned as the value of the lookup. This has many potential secu-
rity problems, and has terrible performance; it should be used only when abso-
lutely necessary.
macro
Set or clear a macro value. To set a macro, pass the value as the first argument in
the map lookup. To clear a macro, do not pass an argument in the map lookup.
The map always returns the empty string. Example of typical usage include:
Kstorage macro
...
# set macro ${MyMacro} to the ruleset match
R$+ $: $(storage {MyMacro} $@ $1 $) $1
# set macro ${MyMacro} to an empty string
R$* $: $(storage {MyMacro} $@ $) $1
# clear macro ${MyMacro}
R$- $: $(storage {MyMacro} $) $1
arith
Perform simple arithmetic operations. The operation is given as key, currently +,
-, *, /, %, |, & (bitwise OR, AND), l (for less than), and = are supported. The two
operands are given as arguments. The lookup returns the result of the computa-
tion, i.e.
TRUE
or
FALSE
for comparisons, integer values otherwise. All options
which are possible for maps are ignored. A simple example is:
Kcomp arith
...
Scheck_etrn
R$* $: $(comp l $@ $&{load_avg} $@ 7 $) $1
RFALSE$# error ...
socket
The socket map uses a simple request/reply protocol over TCP or UNIX domain
sockets to query an external server. Both requests and replies are text based and
encoded as netstrings, i.e., a string "hello there" becomes: