Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / qmgr / qmgr_bounce.c
blobaf11d2acc30fe37ca2b0e755ed1baf607bae0c5c
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* qmgr_bounce
6 /* SUMMARY
7 /* deal with mail that will not be delivered
8 /* SYNOPSIS
9 /* #include "qmgr.h"
11 /* QMGR_QUEUE *qmgr_bounce_recipient(message, recipient, dsn)
12 /* QMGR_MESSAGE *message;
13 /* RECIPIENT *recipient;
14 /* DSN *dsn;
15 /* DESCRIPTION
16 /* qmgr_bounce_recipient() produces a bounce log record.
17 /* Once the bounce record is written successfully, the recipient
18 /* is marked as done. When the bounce record cannot be written,
19 /* the message structure is updated to reflect that the mail is
20 /* deferred.
22 /* Arguments:
23 /* .IP message
24 /* Open queue file with the message being bounced.
25 /* .IP recipient
26 /* The recipient that will not be delivered.
27 /* .IP dsn
28 /* Delivery status information. See dsn(3).
29 /* DIAGNOSTICS
30 /* Panic: consistency check failure. Fatal: out of memory.
31 /* LICENSE
32 /* .ad
33 /* .fi
34 /* The Secure Mailer license must be distributed with this software.
35 /* AUTHOR(S)
36 /* Wietse Venema
37 /* IBM T.J. Watson Research
38 /* P.O. Box 704
39 /* Yorktown Heights, NY 10598, USA
40 /*--*/
42 /* System library. */
44 #include <sys_defs.h>
46 /* Utility library. */
48 /* Global library. */
50 #include <bounce.h>
51 #include <deliver_completed.h>
53 /* Application-specific. */
55 #include "qmgr.h"
57 /* qmgr_bounce_recipient - bounce one message recipient */
59 void qmgr_bounce_recipient(QMGR_MESSAGE *message, RECIPIENT *recipient,
60 DSN *dsn)
62 MSG_STATS stats;
63 int status;
65 status = bounce_append(message->tflags, message->queue_id,
66 QMGR_MSG_STATS(&stats, message), recipient,
67 "none", dsn);
69 if (status == 0)
70 deliver_completed(message->fp, recipient->offset);
71 else
72 message->flags |= status;