Milter xxfi_data()

Process the DATA command V8.14 and later

After the connecting client has sent the last of its recipients (after all SMTP RCPT To: commands have been sent), the client normally begins to send the message itself by issuing the SMTP DATA command. After the DATA command has been received, but before sendmail responds to that SMTP DATA command, the xxfi_data() function, if used, is called.

The xxfi_data() function is called like this:

sfsistat
xxfi_data(SMFICTX *ctx)

Here, ctx is the context pointer passed to all xxfi_ functions to maintain state in a multithreaded environment. That is the only argument passed.

The xxfi_data() function is useful as a means to reject an envelope after all the envelope recipients have been specified. Such a rejection can occur, for example, because more than the number of envelopes allowed from a particular sender were received, or because the ratio of accepted versus rejected recipients by your Milter was too low. The value returned by xxfi_data() specifies how you wish the DATA command handled:

SMFIS_CONTINUE

Allow the DATA command and thus the current envelope, and continue handling the current envelope. This is the default return value if you don’t declare a data handler in smfiDesc (Milter smfi_register() on page 1194).

SMFIS_ACCEPT

Accept the DATA command and thus the current envelope. Your Milter will not be called again for this envelope.

SMFIS_REJECT

Reject the DATA command (with a 5yz SMTP code), and thus the current envelope. Your Milter ...

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.