immd_return, immd_return_add_entry - NOTARY routines
#include <imta.h>
int immd_return(immd_t md);
int immd_return_add_entry( immd_t md, const char *adr, const char *origadr, const char *reason, im_dlv_stat_t action);
This set of functions is used by channel programs to support NOTARY, that is the generation of Delivery Status Notifications (DSN) per RFC 1891.
immd_return() enqueues a DSN addressed to the originator of the message being dequeued and, depending on the channel configuration, to the local postmaster. The DSN information is held in the dequeue context object md.
The dequeue context holds one entry per recipient for whom a DSN is needed. In other words, for each recipient and its delivery status, a return entry must be added when the delivery status matches one of the delivery statusses for whom the originator had requested a DSN for this recipient. For more details, refer to RFC 1891. immd_return_add_entry() is used to add an entry described by its address adr and original address, origadr to a return context. The addition of the first entry has also the effect of creating the return context.
immd_get_recipient() can be used to obtain the notary flags associated with each recipient. Similarly, imme_add_recipient() can be used to request a non-default DSN per recipient, when originating a message.
action specified the delivery status corresponding to the entry being added to the DSN and can be given one of the following values:
reason can be used to include a more human readable explanation of the delivery status in the DSN message.
The memory allocated for DSN generation is freed automatically when calling immd_dequeue() or immd_defer().
All these functions return IMRC_OK when successful, and one of the following error codes otherwise:
A textual explanation of the failure can be obtained by calling imta_error() immediately afterwards.
center, box; c | c l | l .
Attribute Type Attribute Value
_
imme_add_recipient(3) , immd_get_recipient(3) , imta_error(3)