immd_defer - Defers a message for later processing.
#include <imta.h>
int immd_defer(immd_t md, int increment, char *reason);
immd_defer() may be called to defer processing of the currently accessed message. The deferred message will be left in the message queues for processing by a subsequent processing job. If the message continues to remain in the message queues long enough, it will be returned automatically. See the message return and bouncing discussions in the «SIMS Administrator's Guide» for further details on this subject. Typically message processing is deferred when a temporary error (e.g., network link down, message recipient is over quota, etc.) or an unexpected error occurs. In the event of a permanent error, the message should be returned using immd_return().
Each time a message is deferred, an explanation of why the message is being deferred may be placed in the message's «delivery failure log". This failure log can be read with immd_read_failure_log() when the previously deferred message is again accessed. Should the message be returned as an undeliverable message by SIMS's MTA, a copy of the log will be included with the returned message. The log is only generated if you specify the reason argument. If this parameter is never used for a given message, then that message will have no delivery failure log. increment Specifies whether or not the message retry count should be incremented. When reason is specified (not NULL), this argument is ignored and the message retry count incremented. No firm guidelines exist to determine when the retry count should or should not be incremented. In general, however, it should be incremented. This helps postmasters to spot messages which have defied delivery.
immd_defer() return IMRC_OK when successful, and one of the following error codes otherwise.
_______________________________________
immd_init(3) , immd_return(3) , imta_error(3) , immd_read_failure_log(3)