Sendmail 8.13.3 Programmer's Guide

Milter APIs
Data Access APIs
Chapter 2 23
#include <libmilter/mfapi.h>
int smfi_setmlreply(
SMFICTX *ctx,
char *rcode,
char *xcode,
...
);
Following are some points to consider regarding smfi_setmlreply():
Values passed to smfi_setmlreply() are not checked for standards
compliance.
The message parameter must contain only printable characters;
other characters can result in a undefined behavior. For example, CR
or LR causes the call to fail, a single % (percentage) character causes
the text to be ignored (if a % is required in a string, use %% similar to
the usage in printf (3)).
If the reply code (rcode) is 4XX but SMFI-REJECT is used for the
message, the custom reply is not used.
Similarly, if the reply code (rcode)is5XX code but SMFI_TEMPFAIL is
used for the message, the custom reply is not used.
NOTE An error is not returned to the Milter program in neither of the
previous two cases; libmilter silently ignores the reply code.
For details about reply codes and their meanings, see RFC 821 or
2821, and RFC 1893 or RFC 2034.
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_setmlreply() with the following argument:
ctx Specifies an opaque context structure.
rcode Specifies the 3-digit SMTP reply code as specified in
RFC 821 (Simple Mail Transfer Protocol) or 2821
(Simple Mail Transfer Protocol). rcode is a
null-terminated string and must be a valid 4XX or 5XX
reply code. You must not set rcode to a NULL value.