This is the Title of the Book, eMatter Edition
Copyright ?© 2007 O??™Reilly & Associates, Inc. All rights reserved.
794 | Chapter 21: The D (Define a Macro) Configuration Command
These rules appear in the parse rule set 0. By the time they are reached, other rules
have forwarded any nonlocal mail to the hub. What is left in the workspace is a lone
username. The first rule in the preceding example matches the workspace and
rewrites it to be the sending protocol ($&r; see ?§21.9.82 on page 842), an @, the sending
host ($&s; see ?§21.9.87 on page 844), and the username in angle brackets:
user becomes?†’ smtp @ hub < user >
The second rule checks to make sure the message was received with the SMTP protocol
from the hub. If it was, the local delivery agent is used to deliver the message on
the local machine. If it was received from any other host or by any other protocol,
the second rule fails and the third forwards the lone user address to the hub.
21.6 Macro Conditionals: $?, $|, and $.
Occasionally, it is necessary to test a sendmail macro to see whether a value has been
assigned to it. To perform sucha test, a special prefix and two operators are used.
The general form is:
if else endif
?†“ ?†“ ?†“
$?x text1 $| text2 $.
?†‘ ?†‘
if x is defined if x is not defined
This expression yields one of two possible values: text1 if the macro named x has a
value, and text2 if it doesn??™t.
Pages:
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395