~ubuntu-branches/ubuntu/trusty/postfix/trusty-updates

« back to all changes in this revision

Viewing changes to src/oqmgr/qmgr_bounce.c

Tags: upstream-2.3.1
ImportĀ upstreamĀ versionĀ 2.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
/* SYNOPSIS
7
7
/*      #include "qmgr.h"
8
8
/*
9
 
/*      QMGR_QUEUE *qmgr_bounce_recipient(message, recipient, format, ...)
 
9
/*      QMGR_QUEUE *qmgr_bounce_recipient(message, recipient, dsn)
10
10
/*      QMGR_MESSAGE *message;
11
 
/*      QMGR_RCPT *recipient;
12
 
/*      const char *format;
 
11
/*      RECIPIENT *recipient;
 
12
/*      DSN     *dsn;
13
13
/* DESCRIPTION
14
14
/*      qmgr_bounce_recipient() produces a bounce log record.
15
15
/*      Once the bounce record is written successfully, the recipient
22
22
/*      Open queue file with the message being bounced.
23
23
/* .IP recipient
24
24
/*      The recipient that will not be delivered.
25
 
/* .IP format
26
 
/*      Free-format text that describes why delivery will not happen.
 
25
/* .IP dsn
 
26
/*      Delivery status information. See dsn(3).
27
27
/* DIAGNOSTICS
28
28
/*      Panic: consistency check failure. Fatal: out of memory.
29
29
/* LICENSE
40
40
/* System library. */
41
41
 
42
42
#include <sys_defs.h>
43
 
#include <stdarg.h>
44
43
 
45
44
/* Utility library. */
46
45
 
55
54
 
56
55
/* qmgr_bounce_recipient - bounce one message recipient */
57
56
 
58
 
void    qmgr_bounce_recipient(QMGR_MESSAGE *message, QMGR_RCPT *recipient,
59
 
                                      const char *format,...)
 
57
void    qmgr_bounce_recipient(QMGR_MESSAGE *message, RECIPIENT *recipient,
 
58
                                      DSN *dsn)
60
59
{
61
 
    va_list ap;
 
60
    MSG_STATS stats;
62
61
    int     status;
63
62
 
64
 
    va_start(ap, format);
65
 
    status = vbounce_append(message->tflags, message->queue_id,
66
 
                            recipient->orig_rcpt, recipient->address,
67
 
                            recipient->offset, "none", message->arrival_time,
68
 
                            format, ap);
69
 
    va_end(ap);
 
63
    status = bounce_append(message->tflags, message->queue_id,
 
64
                           QMGR_MSG_STATS(&stats, message), recipient,
 
65
                           "none", dsn);
70
66
 
71
67
    if (status == 0)
72
68
        deliver_completed(message->fp, recipient->offset);