1
#ifndef _DELIVER_REQUEST_H_INCLUDED_
2
#define _DELIVER_REQUEST_H_INCLUDED_
8
/* mail delivery request protocol, server side
10
/* #include <deliver_request.h>
23
#include <recipient_list.h>
26
* Structure of a server mail delivery request.
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 */
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.
53
#define DEL_REQ_ATTR_AVAIL(a) (*(a))
56
* How to deliver, really?
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 */
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 */
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)
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)
75
* Per-recipient delivery status. Not to be confused with per-delivery
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
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.
92
#define DEL_STAT_FINAL 0 /* delivered or bounced */
93
#define DEL_STAT_DEFER (-1) /* not delivered or bounced */
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);
99
extern int deliver_pass(const char *, const char *, DELIVER_REQUEST *, const char *, const char *, long);
104
/* The Secure Mailer license must be distributed with this software.
107
/* IBM T.J. Watson Research
109
/* Yorktown Heights, NY 10598, USA