5
/* deal with mail that must be delivered later
9
/* void qmgr_defer_recipient(message, recipient, reason)
10
/* QMGR_MESSAGE *message;
11
/* QMGR_RCPT *recipient;
12
/* const char *reason;
14
/* void qmgr_defer_todo(queue, reason)
16
/* const char *reason;
18
/* QMGR_QUEUE *qmgr_defer_transport(transport, reason)
19
/* QMGR_TRANSPORT *transport;
20
/* const char *reason;
22
/* qmgr_defer_recipient() defers delivery of the named message to
23
/* the named recipient. It updates the message structure and writes
26
/* qmgr_defer_todo() iterates over all "todo" deliveries queued for
27
/* the named site, and calls qmgr_defer_recipient() for each recipient
28
/* found. Side effects caused by qmgr_entry_done(), qmgr_queue_done(),
29
/* and by qmgr_active_done(): in-core queue entries will disappear,
30
/* in-core queues may disappear, in-core and on-disk messages may
31
/* disappear, bounces may be sent, new in-core queues, queue entries
32
/* and recipients may appear.
34
/* qmgr_defer_transport() calls qmgr_defer_todo() for each queue
35
/* that depends on the named transport. See there for side effects.
39
/* A recipient address; used for logging purposes, and for updating
40
/* the message-specific \fIdefer\fR log.
42
/* Specifies a queue with delivery requests for a specific next-hop
43
/* host (or local user).
45
/* Specifies a message delivery transport.
47
/* Free-format text that describes why delivery is deferred; this
48
/* used for logging purposes, and for updating the message-specific
51
/* The side effects of calling this routine are quite dramatic.
53
/* Panic: consistency check failure. Fatal: out of memory.
57
/* The Secure Mailer license must be distributed with this software.
60
/* IBM T.J. Watson Research
62
/* Yorktown Heights, NY 10598, USA
69
/* Utility library. */
78
/* Application-specific. */
82
/* qmgr_defer_transport - defer todo entries for named transport */
84
void qmgr_defer_transport(QMGR_TRANSPORT *transport, const char *reason)
86
char *myname = "qmgr_defer_transport";
94
msg_panic("%s: null reason", myname);
96
msg_info("defer transport %s: %s", transport->name, reason);
99
* Proceed carefully. Queues may disappear as a side effect.
101
for (queue = transport->queue_list.next; queue; queue = next) {
102
next = queue->peers.next;
103
qmgr_defer_todo(queue, reason);
107
/* qmgr_defer_todo - defer all todo queue entries for specific site */
109
void qmgr_defer_todo(QMGR_QUEUE *queue, const char *reason)
111
char *myname = "qmgr_defer_todo";
114
QMGR_MESSAGE *message;
115
QMGR_RCPT *recipient;
122
msg_panic("%s: null reason", myname);
124
msg_info("defer site %s: %s", queue->name, reason);
127
* Proceed carefully. Queue entries will disappear as a side effect.
129
for (entry = queue->todo.next; entry != 0; entry = next) {
130
next = entry->peers.next;
131
message = entry->message;
132
for (nrcpt = 0; nrcpt < entry->rcpt_list.len; nrcpt++) {
133
recipient = entry->rcpt_list.info + nrcpt;
134
qmgr_defer_recipient(message, recipient, reason);
136
qmgr_entry_done(entry, QMGR_QUEUE_TODO);
140
/* qmgr_defer_recipient - defer delivery of specific recipient */
142
void qmgr_defer_recipient(QMGR_MESSAGE *message, QMGR_RCPT *recipient,
145
char *myname = "qmgr_defer_recipient";
151
msg_panic("%s: reason 0", myname);
154
* Update the message structure and log the message disposition.
156
message->flags |= defer_append(message->tflags, message->queue_id,
157
recipient->orig_rcpt, recipient->address,
158
recipient->offset, "none",
159
message->arrival_time,
160
"delivery temporarily suspended: %s", reason);