A Trick
In debugging large configuration files, the output
that is produced by the -d21.15
switch can become too huge to
examine conveniently. A good alternative (when
modifying or adding rules) is to temporarily insert
a fake subroutine call before and after individual
rules to see what they do:
R$* $:$>TEST $1 ← fake subroutine call Rlhs rhs ← new rule R$* $:$>TEST $1 ← fake subroutine call
With the fake wrapper around the new rule (the name
TEST
is
arbitrary), ordinary rule testing with -bt
now shows how the
address is rewritten by that rule:
3 input: ...
TEST input: ...
TEST returns: ...
← new rule acted here
TEST input: ...
TEST returns: ...
3 returns: ...
>
If you use this technique, remember, of course, to remove the fake subroutine calls before putting that configuration file into use.
Get sendmail, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.