Configuration Lines

Selected configuration file lines can be entered in rule-testing mode. They will behave just as they do when being read from the configuration file. For V8.8 sendmail and above, three configuration commands are honored:

#

Commands that begin with a # are treated as comments and ignored. Blank lines are also ignored.

D

The D configuration command (Section 21.3) is used to define a sendmail macro. Both single-character and multicharacter sendmail macro names can be used.

C

The C configuration command (Section 22.1) is used to add a value to a class. Both single-character and multicharacter class names can be used.

The # can begin a line. The other two configuration commands in rule-testing mode must begin with a dot:

.D{ntries} 23
.Cw localhost

Failure to use a dot will produce this error message:

Undefined ruleset Cw

The use of any character other than the two listed will produce this error:

Unknown "." command .bad command here

To get a usage message, just type a dot:

> .
Usage: .[DC]macro value(s)

Define a Macro with .D

The .D rule-testing command is used to define a sendmail macro. One use for this command might be to modify a rule that depends on the $& prefix (Section 21.5.3). For example, consider this small configuration file that contains a rule in parse rule set 0 that is intended to deliver a local user’s address via the local delivery agent:

V10
Sparse=0
R$+      $#local $@ $&X $: $1

If $X has a value, this rule returns that value as the host (the $@) part of a parse ...

Get Sendmail, 3rd 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.