summaryrefslogtreecommitdiffabout
path: root/doc/mailfromd.texi
Side-by-side diff
Diffstat (limited to 'doc/mailfromd.texi') (more/less context) (ignore whitespace changes)
-rw-r--r--doc/mailfromd.texi86
1 files changed, 76 insertions, 10 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi
index 3d2e43c..090222e 100644
--- a/doc/mailfromd.texi
+++ b/doc/mailfromd.texi
@@ -1357,7 +1357,12 @@ code: @code{continue}, @code{accept}, @code{reject}, @code{discard},
and @code{tempfail}. Among these, @code{reject} and @code{discard}
-can optionally take one to three arguments. The first
-argument is a three-digit @acronym{RFC} 2821 reply code. It must begin with
-@samp{5} for @code{reject} and with @samp{4} for @code{tempfail}. If
-two arguments are supplied, the second argument must be either an
-@dfn{extended reply code} (@acronym{RFC} 1893/2034) or a textual string to be
+can optionally take one to three arguments. There are two ways of
+supplying the arguments.
+
+In the first form, called @dfn{literal} or @dfn{traditional} notation,
+the arguments are supplied as additional words after the action name,
+separated by whitespace. The first argument is a three-digit
+@acronym{RFC} 2821 reply code. It must begin with @samp{5} for
+@code{reject} and with @samp{4} for @code{tempfail}. If two arguments
+are supplied, the second argument must be either an @dfn{extended
+reply code} (@acronym{RFC} 1893/2034) or a textual string to be
returned along with the @acronym{SMTP} reply. Finally, if all three
@@ -1366,3 +1371,3 @@ code and the third one must supply the textual string. The following
examples illustrate all possible ways of using the @code{reject}
-statement:
+statement in literal notation:
@@ -1381,2 +1386,21 @@ Please note the quotes around the textual string.
+Another form for these action is called @dfn{functional} notation,
+because it resembles the function syntax. When used in this form, the
+action word is followed by a parenthesized group of exactly three
+arguments, separated by commas. The meaning and ordering of the
+argument is the same as in literal form. Any of three arguments may
+be absent, in which case it will be replaced by the default value. To
+illustrate this, here are the statements from the previous example,
+written in functional notation:
+
+@smallexample
+@group
+reject(,,)
+reject(503,,)
+reject(503, 5.0.0)
+reject(503,, "Need HELO command")
+reject(503, 5.0.0, "Need HELO command")
+@end group
+@end smallexample
+
@node Conditional Execution
@@ -10255,3 +10279,4 @@ two kinds of actions: return actions and header manipulation actions.
- Return actions tell @command{Sendmail} to return given response code
+@subsubheading Reply Actions
+Reply actions tell @command{Sendmail} to return given response code
to the remote party. There are five such actions:
@@ -10265,3 +10290,4 @@ transmitting its message.
-@item reject [@var{code}] [@var{excode}] [@var{message}]
+@item reject @var{code} @var{excode} @var{message-expr}
+@itemx reject (@var{code-expr}, @var{excode-expr}, @var{message-expr})
@cindex reject action, defined
@@ -10272,3 +10298,4 @@ their usage is described below.
-@item tempfail [@var{code}] [@var{excode}] [@var{message}]
+@item tempfail @var{code} @var{excode} @var{message}
+@itemx tempfail (@var{code-expr}, @var{excode-expr}, @var{message-expr})
@cindex tempfail action, defined
@@ -10294,3 +10321,8 @@ continue processing of the message.
Two actions, @code{reject} and @code{tempfail} can take up to three
-optional parameters. The first argument is a three-digit
+optional parameters. There are two forms of supplying these
+parameters.
+
+In the first form, called @dfn{literal} or @dfn{traditional} notation,
+the arguments are supplied as additional words after the action name,
+and are separated by whitespace. The first argument is a three-digit
@acronym{RFC} 2821 reply code. It must begin with @samp{5} for
@@ -10315,2 +10347,36 @@ reject 503 5.0.0 "Need HELO command"
+The notion @dfn{textual string}, used above means either a literal
+string or an @acronym{MFL} expression that evaluates to string.
+However, both code and extended code must always be literal.
+
+The second form of supplying arguments is called @dfn{functional}
+notation, because it resembles the function syntax. When used in this
+form, the action word is followed by a parenthesized group of exactly
+three arguments, separated by commas. Each argument is a
+@acronym{MFL} expression. The meaning and ordering of the arguments is
+the same as in literal form. Any or all of these three arguments may
+be absent, in which case it will be replaced by the default value. To
+illustrate this, here are the statements from the previous example,
+written in functional notation:
+
+@smallexample
+@group
+reject(,,)
+reject(503,,)
+reject(503, 5.0.0)
+reject(503, "Need HELO command",)
+reject(503, 5.0.0, "Need HELO command")
+@end group
+@end smallexample
+
+ Notice that there is an important difference between the two
+notations. The functional notation allows to compute both reply codes
+at run time, e.g.:
+
+@smallexample
+ reject(500 + %dig2*10 + %dig3, "5." %edig2 "." %edig2)
+@end smallexample
+
+@subsubheading Header Actions
+
@anchor{header manipulation}

Return to:

Send suggestions and report system problems to the System administrator.