~ubuntu-branches/ubuntu/raring/postfix/raring

« back to all changes in this revision

Viewing changes to src/oqmgr/qmgr_deliver.c

Tags: upstream-2.2.6
ImportĀ upstreamĀ versionĀ 2.2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
    }
144
144
 
145
145
    flags = message->tflags
 
146
        | entry->queue->dflags
146
147
        | (message->inspect_xport ? DEL_REQ_FLAG_BOUNCE : DEL_REQ_FLAG_DEFLT);
147
148
    attr_print(stream, ATTR_FLAG_MORE,
148
149
               ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags,
160
161
               ATTR_TYPE_STR, MAIL_ATTR_CLIENT_ADDR, message->client_addr,
161
162
               ATTR_TYPE_STR, MAIL_ATTR_PROTO_NAME, message->client_proto,
162
163
               ATTR_TYPE_STR, MAIL_ATTR_HELO_NAME, message->client_helo,
 
164
               ATTR_TYPE_STR, MAIL_ATTR_SASL_METHOD, message->sasl_method,
 
165
               ATTR_TYPE_STR, MAIL_ATTR_SASL_USERNAME, message->sasl_username,
 
166
               ATTR_TYPE_STR, MAIL_ATTR_SASL_SENDER, message->sasl_sender,
 
167
               ATTR_TYPE_STR, MAIL_ATTR_RWR_CONTEXT, message->rewrite_context,
163
168
               ATTR_TYPE_END);
164
169
    if (sender_buf != 0)
165
170
        vstring_free(sender_buf);
205
210
    QMGR_MESSAGE *message = entry->message;
206
211
    VSTRING *reason = vstring_alloc(1);
207
212
    int     status;
 
213
    QMGR_RCPT *recipient;
 
214
    int     nrcpt;
208
215
 
209
216
    /*
210
217
     * The message transport has responded. Stop the watchdog timer.
234
241
        qmgr_transport_throttle(transport, "unknown mail transport error");
235
242
        msg_warn("transport %s failure -- see a previous warning/fatal/panic logfile record for the problem description",
236
243
                 transport->name);
 
244
 
 
245
        /*
 
246
         * Assume the worst and write a defer logfile record for each
 
247
         * recipient. This omission was already present in the first queue
 
248
         * manager implementation of 199703, and was fixed 200511.
 
249
         * 
 
250
         * Don't move this queue entry back to the todo queue so that
 
251
         * qmgr_defer_transport() can update the defer log. The queue entry
 
252
         * is still hot, and making it cold would involve duplicating most
 
253
         * but not all code at the end of this routine. That's too tricky.
 
254
         */
 
255
        for (nrcpt = 0; nrcpt < entry->rcpt_list.len; nrcpt++) {
 
256
            recipient = entry->rcpt_list.info + nrcpt;
 
257
            qmgr_defer_recipient(message, recipient, transport->reason);
 
258
        }
237
259
        qmgr_defer_transport(transport, transport->reason);
238
260
    }
239
261
 
259
281
     * No problems detected. Mark the transport and queue as alive. The queue
260
282
     * itself won't go away before we dispose of the current queue entry.
261
283
     */
262
 
    if (VSTRING_LEN(reason) == 0) {
 
284
    if (status != DELIVER_STAT_CRASH && VSTRING_LEN(reason) == 0) {
263
285
        qmgr_transport_unthrottle(transport);
264
286
        qmgr_queue_unthrottle(queue);
265
287
    }