Sendmail 8.13.3 Programmer's Guide
Table Of Contents

Milter APIs
Data Access APIs
Chapter 222
• If the Milter program returns SMFI_TEMPFAIL and sets the reply code
to 421, the SMTP server terminates the SMTP session with a 421
error code.
Arguments
You must call smfi_setreply() with the following arguments:
ctx Specifies an opaque context structure.
rcode Specifies a 3-digit (RFC 821 or RFC 2821) SMTP reply
code as a null terminated string. You must not assign
rcode to NULL, and rcode must be a valid 4XX or 5XX
reply code.
xcode Specifies an extended (RFC 1893 or RFC 2034) reply
code. If xcode is NULL, the extended code is not used.
xcode must conform to RFC 1893 or RFC 2034.
message Specifies the text part of the SMTP reply. If the
message is NULL, an empty message is used.
Return Value
smfi_setreply() fails because of the following reasons and returns
MI_FAILURE:
• The rcode argument or xcode argument is invalid.
• A memory-allocation failure occurs.
smfi_setreply() returns MI_SUCCESS on success.
The smfi_setmlreply() API
You can use the smfi_setmlreply() API to set the default SMTP error
reply code to a multi-line response. You can set only 4xx and 5xx reply
codes.
You can call smfi_setmlreply() from any of the xxfi_* callbacks
except the xxfi_connect() callback. smfi_setmlreply() directly sets
the SMTP error reply code for a connection to the given lines after xcode.
You must terminate the list of arguments that you pass to
smfi_setmlreply() with a NULL value. The error code is used on
subsequent error replies resulting from actions taken by the filter
program.
The declaration of smfi_setmlreply() is as follows: