5
/* log that a message was sent
9
/* int sent(flags, queue_id, orig_rcpt, recipient, offset, relay,
10
/* entry, format, ...)
12
/* const char *queue_id;
13
/* const char *orig_rcpt;
14
/* const char *recipient;
18
/* const char *format;
20
/* int vsent(flags, queue_id, orig_rcpt, recipient, offset, relay,
23
/* const char *queue_id;
24
/* const char *orig_rcpt;
25
/* const char *recipient;
29
/* const char *format;
32
/* sent() logs that a message was successfully delivered,
33
/* updates the address verification service, or updates a
34
/* message delivery record on request by the sender. The
35
/* flags argument determines the action.
37
/* vsent() implements an alternative interface.
41
/* Zero or more of the following:
44
/* The message is a normal delivery request.
45
/* .IP DEL_REQ_FLAG_VERIFY
46
/* The message is an address verification probe. Update the
47
/* address verification database.
48
/* .IP DEL_REQ_FLAG_EXPAND
49
/* The message is an address expansion probe. Update the
50
/* message delivery record.
51
/* .IP DEL_REQ_FLAG_RECORD
52
/* This is a normal message with logged delivery. Update the
53
/* the message delivery record.
56
/* The message queue id.
58
/* The original envelope recipient address. If unavailable,
59
/* specify a null string or a null pointer.
61
/* The recipient address.
63
/* Queue file offset of the recipient record.
65
/* Name of the host we're talking to.
67
/* Message arrival time.
69
/* Optional additional information.
71
/* A non-zero result means the operation failed.
73
/* Fatal: out of memory.
75
/* Should be replaced by routines with an attribute-value based
76
/* interface instead of an interface that uses a rigid argument list.
80
/* The Secure Mailer license must be distributed with this software.
83
/* IBM T.J. Watson Research
85
/* Yorktown Heights, NY 10598, USA
92
#include <stdlib.h> /* 44BSD stdarg.h uses abort() */
96
#ifdef STRCASECMP_IN_STRINGS_H
100
/* Utility library. */
105
/* Global library. */
107
#include <mail_params.h>
109
#include <log_adhoc.h>
114
/* Application-specific. */
116
/* sent - log that a message was sent */
118
int sent(int flags, const char *id, const char *orig_rcpt,
119
const char *recipient, long offset, const char *relay,
120
time_t entry, const char *fmt,...)
126
status = vsent(flags, id, orig_rcpt, recipient,
127
offset, relay, entry, fmt, ap);
132
/* vsent - log that a message was sent */
134
int vsent(int flags, const char *id, const char *orig_rcpt,
135
const char *recipient, long offset, const char *relay,
136
time_t entry, const char *fmt, va_list ap)
141
* MTA-requested address verification information is stored in the verify
144
if (flags & DEL_REQ_FLAG_VERIFY) {
145
status = vverify_append(id, orig_rcpt, recipient, relay, entry,
146
"deliverable", DEL_RCPT_STAT_OK, fmt, ap);
151
* User-requested address verification information is logged and mailed
152
* to the requesting user.
154
if (flags & DEL_REQ_FLAG_EXPAND) {
155
status = vtrace_append(flags, id, orig_rcpt, recipient, relay,
156
entry, "2.0.0", "deliverable", fmt, ap);
161
* Normal mail delivery. May also send a delivery record to the user.
164
VSTRING *text = vstring_alloc(10);
166
vstring_vsprintf(text, fmt, ap);
167
if ((flags & DEL_REQ_FLAG_RECORD) == 0
168
|| trace_append(flags, id, orig_rcpt, recipient, relay,
169
entry, "2.0.0", "delivered",
170
"%s", vstring_str(text)) == 0) {
171
log_adhoc(id, orig_rcpt, recipient, relay,
172
entry, "sent", "%s", vstring_str(text));
175
status = defer_append(flags, id, orig_rcpt, recipient, offset,
176
relay, entry, "%s: %s service failed",
177
id, var_trace_service);