7 /* update verify database
11 /* int verify_append(queue_id, stats, recipient, relay, dsn,
13 /* const char *queue_id;
15 /* RECIPIENT *recipient;
20 /* This module implements an impedance adaptor between the
21 /* verify_clnt interface and the interface expected by the
22 /* bounce/defer/sent modules.
24 /* verify_append() updates the address verification database
25 /* and logs the action to the mailer logfile.
29 /* The message queue id.
31 /* Time stamps from different message delivery stages
32 /* and session reuse count.
34 /* Recipient information. See recipient_list(3).
36 /* Name of the host we're talking to.
38 /* Delivery status information. See dsn(3).
39 /* The action is one of "deliverable" or "undeliverable".
41 /* One of the following recipient verification status codes:
43 /* .IP DEL_REQ_RCPT_STAT_OK
44 /* Successful delivery.
45 /* .IP DEL_REQ_RCPT_STAT_DEFER
46 /* Temporary delivery error.
47 /* .IP DEL_REQ_RCPT_STAT_BOUNCE
48 /* Hard delivery error.
51 /* A non-zero result means the operation failed.
53 /* Fatal: out of memory.
55 /* Should be replaced by routines with an attribute-value based
56 /* interface instead of an interface that uses a rigid argument list.
60 /* The Secure Mailer license must be distributed with this software.
63 /* IBM T.J. Watson Research
65 /* Yorktown Heights, NY 10598, USA
73 #ifdef STRCASECMP_IN_STRINGS_H
77 /* Utility library. */
84 #include <mail_params.h>
85 #include <mail_proto.h>
86 #include <verify_clnt.h>
87 #include <log_adhoc.h>
90 /* verify_append - update address verification database */
92 int verify_append(const char *queue_id
, MSG_STATS
*stats
,
93 RECIPIENT
*recipient
, const char *relay
,
94 DSN
*dsn
, int vrfy_stat
)
100 * Impedance adaptor between bounce/defer/sent and verify_clnt.
102 * XXX No DSN check; this routine is called from bounce/defer/sent, which
103 * know what the DSN initial digit should look like.
105 * XXX vrfy_stat is competely redundant because of dsn.
107 if (var_verify_neg_cache
|| vrfy_stat
== DEL_RCPT_STAT_OK
) {
108 req_stat
= verify_clnt_update(recipient
->orig_addr
, vrfy_stat
,
110 if (req_stat
== VRFY_STAT_OK
&& strcasecmp(recipient
->address
,
111 recipient
->orig_addr
) != 0)
112 req_stat
= verify_clnt_update(recipient
->address
, vrfy_stat
,
115 my_dsn
.action
= "undeliverable-but-not-cached";
116 req_stat
= VRFY_STAT_OK
;
118 if (req_stat
== VRFY_STAT_OK
) {
119 log_adhoc(queue_id
, stats
, recipient
, relay
, dsn
, my_dsn
.action
);
122 msg_warn("%s: %s service failure", queue_id
, var_verify_service
);