HPlogo Sendmail 8.13.3 Programmer's Guide: HP-UX 11i v1 and HP-UX 11i v2 > Chapter 2 Milter APIs

Other Message Handling APIs

» 

Technical documentation

Complete book in PDF

 » Table of Contents

The following APIs provide special case handling instructions for the Milter API or the MTA, without altering the content or status of the message:

  • smfi_progress()

  • smfi_quarantine()

You can call these APIs only in the xxfi_eom() callback. These APIs can invoke additional communication with the MTA. They return either MI_SUCCESS or MI_FAILURE to indicate the status of the operation.

The status returned by these functions indicate whether the message of the filter was successfully sent to the MTA and does not indicate whether the MTA performed the requested operation.

The smfi_progress() API

You can use the smfi_progress() API to notify an MTA that an operation is still working on a message causing the MTA to restart its timeout values. You can call smfi_progress() from the xxfi_eom() callback.

The declaration of smfi_progress() is as follows:

#include <libmilter/mfapi.h>
int smfi_progress(
        SMFICTX *ctx;
);

Argument

You must call smfi_progress() with the ctx argument, which specifies an opaque context structure.

Return Values

smfi_progress() returns MI_FAILURE on failure if a network failure occurs. smfi_progress() returns MI_SUCCESS on success.

The smfi_quarantine() API

You can use the smfi_quarantine() API to quarantine the message using the specific reason. You can call smfi_quarantine() only from the xxfi_eom() callback.

The declaration of smfi_quarantine() is as follows:

#include <libmilter/mfapi.h>
int smfi_quarantine(
        SMFICTX *ctx;
        char *reason;
);

Arguments

You must call smfi_quarantine() with the following arguments:

ctx

Specifies an opaque context structure.

reason

Specifies the quarantine reason, which is a non-NULL and non-empty null-terminated string.

Return Values

smfi_quarantine() returns MI_FAILURE on failure because of the following reasons:

  • The reason argument is NULL or empty.

  • Network error occurs.

  • The SMFIF_QUARANTINE value is not set when the smfi_register() routine is called.

smfi_quarantine() returns MI_SUCCESS on success.