~ubuntu-branches/ubuntu/vivid/postfix/vivid-proposed

« back to all changes in this revision

Viewing changes to src/oqmgr/qmgr_bounce.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2005-02-27 09:33:07 UTC
  • Revision ID: james.westby@ubuntu.com-20050227093307-cn789t27ibnlh6tf
Tags: upstream-2.1.5
ImportĀ upstreamĀ versionĀ 2.1.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*++
 
2
/* NAME
 
3
/*      qmgr_bounce
 
4
/* SUMMARY
 
5
/*      deal with mail that will not be delivered
 
6
/* SYNOPSIS
 
7
/*      #include "qmgr.h"
 
8
/*
 
9
/*      QMGR_QUEUE *qmgr_bounce_recipient(message, recipient, format, ...)
 
10
/*      QMGR_MESSAGE *message;
 
11
/*      QMGR_RCPT *recipient;
 
12
/*      const char *format;
 
13
/* DESCRIPTION
 
14
/*      qmgr_bounce_recipient() produces a bounce log record.
 
15
/*      Once the bounce record is written successfully, the recipient
 
16
/*      is marked as done. When the bounce record cannot be written,
 
17
/*      the message structure is updated to reflect that the mail is
 
18
/*      deferred.
 
19
/*
 
20
/*      Arguments:
 
21
/* .IP message
 
22
/*      Open queue file with the message being bounced.
 
23
/* .IP recipient
 
24
/*      The recipient that will not be delivered.
 
25
/* .IP format
 
26
/*      Free-format text that describes why delivery will not happen.
 
27
/* DIAGNOSTICS
 
28
/*      Panic: consistency check failure. Fatal: out of memory.
 
29
/* LICENSE
 
30
/* .ad
 
31
/* .fi
 
32
/*      The Secure Mailer license must be distributed with this software.
 
33
/* AUTHOR(S)
 
34
/*      Wietse Venema
 
35
/*      IBM T.J. Watson Research
 
36
/*      P.O. Box 704
 
37
/*      Yorktown Heights, NY 10598, USA
 
38
/*--*/
 
39
 
 
40
/* System library. */
 
41
 
 
42
#include <sys_defs.h>
 
43
#include <stdarg.h>
 
44
 
 
45
/* Utility library. */
 
46
 
 
47
/* Global library. */
 
48
 
 
49
#include <bounce.h>
 
50
#include <deliver_completed.h>
 
51
 
 
52
/* Application-specific. */
 
53
 
 
54
#include "qmgr.h"
 
55
 
 
56
/* qmgr_bounce_recipient - bounce one message recipient */
 
57
 
 
58
void    qmgr_bounce_recipient(QMGR_MESSAGE *message, QMGR_RCPT *recipient,
 
59
                                      const char *format,...)
 
60
{
 
61
    va_list ap;
 
62
    int     status;
 
63
 
 
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);
 
70
 
 
71
    if (status == 0)
 
72
        deliver_completed(message->fp, recipient->offset);
 
73
    else
 
74
        message->flags |= status;
 
75
}