That value is a rounded integer representation of a
possible floating-point value.
One use for this ${load_avg} sendmail macro might be to reject SMTP ETRN commands
when the load average it too high:
LOCAL_CONFIG
D{OurETRNlimit}5
Karith math
LOCAL_RULESETS
Scheck_etrn
R $* $: $(math l $@ $&{load_avg} $@ ${OurETRNlimit} $)
R FALSE $# error $@ 4.7.1 $: "450 The load average is currently too high."
Here, we add two new sections to our mc configuration file. The first, under LOCAL_
CONFIG, defines a sendmail macro, ${OurETRNlimit}, that will hold as its value the limit
we have set to reject ERTN commands. In this mc section, we also defined a database map
of type arith (?§23.7.1 on page 898).
In the second section, following the LOCAL_RULESETS, we declare the check_etrn rule
set (?§19.9.2 on page 706). That rule set is called from inside sendmail (just after an SMTP
ETRN command is received, but before the reply to that command is sent) and can determine
whether the SMTP ETRN command should be allowed. If the rule set returns the
$#error delivery agent, the SMTP ETRN command is denied. Otherwise, it is allowed.
The first rule matches anything in the LHS, then ignores that value in the RHS. The RHS
looks up the current ($&) value of the ${load_avg} macro, then uses the math database map
to compare that value to the limit set in our ${OurETRNlimit} macro.
Pages:
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467