An example of how to use the discard delivery agent looks like this:
LOCAL_CONFIG
C{Discard_To_Names} allmyfriends
LOCAL_RULESETS
HTo: $>Screen_To
SScreen_To
R $={Discard_To_Names} @ $* $# discard $: discard
Here, the value of a To: header (?§25.12.38 on page 1167) is passed to the Screen_To rule set.
That rule set compares the user part of the address to the list of usernames in the class
{Discard_To_Names}. If any are found (in this instance, only the name allmyfriends will be
found), that message is discarded.
Note that when handling spam mail, it can be better to reject the message with the error
delivery agent than to discard it with this discard delivery agent. Rejection pushes the
handling of bounces back onto the sender.
20.4.4 error
Perform a policy-based rejection All versions
All versions of sendmail define a special internal delivery agent called error that is designed
to aid in the issuance of error messages. It is always available for use in the parse rule set 0,
the localaddr rule set 5, and the Local_check and other policy setting rule sets. It cannot be
defined with an M command.
Beginning with V8.7, the form for using the error agent in the RHS of a rule looks like this:
R... $#error $@ dsnstat $: text of error message here
In general terms, the text following the $: is the actual error message that will be included
in bounced mail and sent back to a connecting SMTP host.
Pages:
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261