5
/* update verify database
9
/* int verify_append(queue_id, orig_rcpt, recipient,
10
/* relay, entry, status,
11
/* recipient_status, format, ...)
12
/* const char *queue_id;
13
/* const char *orig_rcpt;
14
/* const char *recipient;
17
/* const char *status;
18
/* int recipient_status;
19
/* const char *format;
21
/* int vverify_append(queue_id, orig_rcpt, recipient,
22
/* relay, entry, status,
23
/* recipient_status, format, ap)
24
/* int recipient_status;
25
/* const char *queue_id;
26
/* const char *orig_rcpt;
27
/* const char *recipient;
30
/* const char *status;
31
/* int recipient_status;
32
/* const char *format;
35
/* This module implements an impedance adaptor between the
36
/* verify_clnt interface and the interface expected by the
37
/* bounce/defer/sent modules.
39
/* verify_append() updates the address verification database
40
/* and logs the action to the mailer logfile.
42
/* vverify_append() implements an alternative interface.
46
/* The message queue id.
48
/* The original envelope recipient address. If unavailable,
49
/* specify a null string or a null pointer.
51
/* The recipient address.
53
/* Name of the host we're talking to.
55
/* Message arrival time.
57
/* "deliverable", "undeliverable", and so on.
58
/* .IP recipient_status
59
/* One of the following recipient verification status codes:
61
/* .IP DEL_REQ_RCPT_STAT_OK
62
/* Successful delivery.
63
/* .IP DEL_REQ_RCPT_STAT_DEFER
64
/* Temporary delivery error.
65
/* .IP DEL_REQ_RCPT_STAT_BOUNCE
66
/* Hard delivery error.
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>
108
#include <mail_proto.h>
109
#include <verify_clnt.h>
110
#include <log_adhoc.h>
113
/* verify_append - update address verification database */
115
int verify_append(const char *queue_id, const char *orig_rcpt,
116
const char *recipient, const char *relay,
117
time_t entry, const char *status,
118
int rcpt_stat, const char *fmt,...)
124
req_stat = vverify_append(queue_id, orig_rcpt, recipient, relay,
125
entry, status, rcpt_stat, fmt, ap);
130
/* vverify_append - update address verification database */
132
int vverify_append(const char *queue_id, const char *orig_rcpt,
133
const char *recipient, const char *relay,
134
time_t entry, const char *status,
135
int rcpt_stat, const char *fmt, va_list ap)
137
VSTRING *text = vstring_alloc(10);
141
* Impedance adaptor between bounce/defer/sent and verify_clnt.
143
vstring_vsprintf(text, fmt, ap);
144
if (var_verify_neg_cache || rcpt_stat == DEL_RCPT_STAT_OK) {
145
req_stat = verify_clnt_update(orig_rcpt, rcpt_stat,
146
"%s", vstring_str(text));
147
if (req_stat == VRFY_STAT_OK && strcasecmp(recipient, orig_rcpt) != 0)
148
req_stat = verify_clnt_update(recipient, rcpt_stat,
149
"%s", vstring_str(text));
151
status = "undeliverable-but-not-cached";
152
req_stat = VRFY_STAT_OK;
154
if (req_stat == VRFY_STAT_OK) {
155
log_adhoc(queue_id, orig_rcpt, recipient, relay,
156
entry, status, "%s", vstring_str(text));
159
msg_warn("%s: %s service failure", queue_id, var_verify_service);