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

« back to all changes in this revision

Viewing changes to src/global/deliver_request.h

  • 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
#ifndef _DELIVER_REQUEST_H_INCLUDED_
 
2
#define _DELIVER_REQUEST_H_INCLUDED_
 
3
 
 
4
/*++
 
5
/* NAME
 
6
/*      deliver_request 3h
 
7
/* SUMMARY
 
8
/*      mail delivery request protocol, server side
 
9
/* SYNOPSIS
 
10
/*      #include <deliver_request.h>
 
11
/* DESCRIPTION
 
12
/* .nf
 
13
 
 
14
 /*
 
15
  * Utility library.
 
16
  */
 
17
#include <vstring.h>
 
18
#include <vstream.h>
 
19
 
 
20
 /*
 
21
  * Global library.
 
22
  */
 
23
#include <recipient_list.h>
 
24
 
 
25
 /*
 
26
  * Structure of a server mail delivery request.
 
27
  */
 
28
typedef struct DELIVER_REQUEST {
 
29
    VSTREAM *fp;                        /* stream, shared lock */
 
30
    int     flags;                      /* see below */
 
31
    char   *queue_name;                 /* message queue name */
 
32
    char   *queue_id;                   /* message queue id */
 
33
    long    data_offset;                /* offset to message */
 
34
    long    data_size;                  /* message size */
 
35
    char   *nexthop;                    /* next hop name */
 
36
    char   *encoding;                   /* content encoding */
 
37
    char   *sender;                     /* envelope sender */
 
38
    char   *errors_to;                  /* error report address */
 
39
    char   *return_receipt;             /* confirm receipt address */
 
40
    long    arrival_time;               /* arrival time */
 
41
    RECIPIENT_LIST rcpt_list;           /* envelope recipients */
 
42
    char   *hop_status;                 /* reason if unavailable */
 
43
    char   *client_name;                /* client hostname */
 
44
    char   *client_addr;                /* client address */
 
45
    char   *client_proto;               /* client protocol */
 
46
    char   *client_helo;                /* helo parameter */
 
47
} DELIVER_REQUEST;
 
48
 
 
49
 /*
 
50
  * Since we can't send null pointers, null strings represent unavailable
 
51
  * attributes instead. They're less likely to explode in our face, too.
 
52
  */
 
53
#define DEL_REQ_ATTR_AVAIL(a)   (*(a))
 
54
 
 
55
 /*
 
56
  * How to deliver, really?
 
57
  */
 
58
#define DEL_REQ_FLAG_DEFLT      (DEL_REQ_FLAG_SUCCESS | DEL_REQ_FLAG_BOUNCE)
 
59
#define DEL_REQ_FLAG_SUCCESS    (1<<0)  /* delete successful recipients */
 
60
#define DEL_REQ_FLAG_BOUNCE     (1<<1)  /* unimplemented */
 
61
 
 
62
#define DEL_REQ_FLAG_VERIFY     (1<<8)  /* verify recipient, don't deliver */
 
63
#define DEL_REQ_FLAG_EXPAND     (1<<9)  /* verify expansion, don't deliver */
 
64
#define DEL_REQ_FLAG_RECORD     (1<<10) /* record and deliver */
 
65
 
 
66
#define DEL_REQ_TRACE_FLAGS_MASK \
 
67
        (DEL_REQ_FLAG_VERIFY | DEL_REQ_FLAG_EXPAND | DEL_REQ_FLAG_RECORD)
 
68
#define DEL_REQ_TRACE_FLAGS(f)  ((f) & DEL_REQ_TRACE_FLAGS_MASK)
 
69
 
 
70
#define DEL_REQ_TRACE_ONLY_MASK \
 
71
        (DEL_REQ_FLAG_VERIFY | DEL_REQ_FLAG_EXPAND)
 
72
#define DEL_REQ_TRACE_ONLY(f)   ((f) & DEL_REQ_TRACE_ONLY_MASK)
 
73
 
 
74
 /*
 
75
  * Per-recipient delivery status. Not to be confused with per-delivery
 
76
  * request status.
 
77
  */
 
78
#define DEL_RCPT_STAT_OK        0
 
79
#define DEL_RCPT_STAT_DEFER     1
 
80
#define DEL_RCPT_STAT_BOUNCE    2
 
81
#define DEL_RCPT_STAT_TODO      3
 
82
 
 
83
 /*
 
84
  * Delivery request status. Note that there are only FINAL and DEFER. This
 
85
  * is because delivery status information can be lost when a delivery agent
 
86
  * or queue manager process terminates prematurely. The only distinctions we
 
87
  * can rely on are "final delivery completed" (positive confirmation that
 
88
  * all recipients are marked as done) and "everything else". In the absence
 
89
  * of a definitive statement the queue manager will always have to be
 
90
  * prepared for all possibilities.
 
91
  */
 
92
#define DEL_STAT_FINAL  0               /* delivered or bounced */
 
93
#define DEL_STAT_DEFER  (-1)            /* not delivered or bounced */
 
94
 
 
95
typedef struct VSTREAM _deliver_vstream_;
 
96
extern DELIVER_REQUEST *deliver_request_read(_deliver_vstream_ *);
 
97
extern int deliver_request_done(_deliver_vstream_ *, DELIVER_REQUEST *, int);
 
98
 
 
99
extern int deliver_pass(const char *, const char *, DELIVER_REQUEST *, const char *, const char *, long);
 
100
 
 
101
/* LICENSE
 
102
/* .ad
 
103
/* .fi
 
104
/*      The Secure Mailer license must be distributed with this software.
 
105
/* AUTHOR(S)
 
106
/*      Wietse Venema
 
107
/*      IBM T.J. Watson Research
 
108
/*      P.O. Box 704
 
109
/*      Yorktown Heights, NY 10598, USA
 
110
/*--*/
 
111
 
 
112
#endif