General-Purpose Mail Filter
A special language construct is provided for verification of sender addresses (callout):
on poll $f do when success: accept when not_found or failure: reject 550 5.1.0 "Sender validity not confirmed" when temp_failure: tempfail 450 4.1.0 "Try again later" done
on poll construct runs standard verification
(see standard verification) for the email address specified as its
argument (in the example above it is the value of the Sendmail macro
‘$f’). The check can result in the following conditions:
The address exists.
The address does not exist.
Some error of permanent nature occurred during the check. The existence of the address cannot be verified.
Some temporary failure occurred during the check. The existence of the address cannot be verified at the moment.
when branches of the
on poll statement
introduce statements, that are executed depending on the actual
return condition. If any condition occurs that is not handled within
on block, the run-time evaluator will signal an
exception4 and return temporary
failure, therefore it is advisable to always handle all four
conditions. In fact, the condition handling shown in the above
example is preferable for most normal configurations: the mail is
accepted if the sender address is proved to exist and rejected
otherwise. If a temporary failure occurs, the remote party is urged
to retry the transaction some time later.
poll statement itself has a number of options that
control the type of the verification. These are discussed in detail
It is worth noticing that there is one special email address which is always available on any host, it is the null address ‘<>’ used in error reporting. It is of no use verifying its existence:
prog envfrom do if $f == "" accept else on poll $f do when success: accept when not_found or failure: reject 550 5.1.0 "Sender validity not confirmed" when temp_failure: tempfail 450 4.1.0 "Try again later" done fi done
This document was generated on January 3, 2019 using makeinfo.Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.