11 /* void deliver_indirect(state)
15 /* deliver_indirect() delivers a message via the message
16 /* forwarding service, with duplicate filtering up to a
17 /* configurable number of recipients.
21 /* The attributes that specify the message, sender and more.
22 /* A table with the results from expanding aliases or lists.
23 /* CONFIGURATION VARIABLES
24 /* duplicate_filter_limit, duplicate filter size limit
26 /* The result is non-zero when the operation should be tried again.
30 /* The Secure Mailer license must be distributed with this software.
33 /* IBM T.J. Watson Research
35 /* Yorktown Heights, NY 10598, USA
43 /* Utility library. */
50 #include <mail_params.h>
53 #include <been_here.h>
56 /* Application-specific. */
60 /* deliver_indirect - deliver mail via forwarding service */
62 int deliver_indirect(LOCAL_STATE state
)
66 * Suppress duplicate expansion results. Add some sugar to the name to
67 * avoid collisions with other duplicate filters. Allow the user to
68 * specify an upper bound on the size of the duplicate filter, so that we
69 * can handle huge mailing lists with millions of recipients.
72 msg_info("deliver_indirect: %s", state
.msg_attr
.rcpt
.address
);
73 if (been_here(state
.dup_filter
, "indirect %s",
74 state
.msg_attr
.rcpt
.address
))
78 * Don't forward a trace-only request.
80 if (DEL_REQ_TRACE_ONLY(state
.request
->flags
)) {
81 dsb_simple(state
.msg_attr
.why
, "2.0.0", "forwards to %s",
82 state
.msg_attr
.rcpt
.address
);
83 return (sent(BOUNCE_FLAGS(state
.request
), SENT_ATTR(state
.msg_attr
)));
87 * Send the address to the forwarding service. Inherit the delivered
88 * attribute from the alias or from the .forward file owner.
90 if (forward_append(state
.msg_attr
)) {
91 dsb_simple(state
.msg_attr
.why
, "4.3.0", "unable to forward message");
92 return (defer_append(BOUNCE_FLAGS(state
.request
),
93 BOUNCE_ATTR(state
.msg_attr
)));