Lines Matching refs:state
11 /* void cleanup_envelope(state, type, buf, len)
12 /* CLEANUP_STATE *state;
24 /* .IP state
25 /* Queue file and message processing state. This state is updated
91 void cleanup_envelope(CLEANUP_STATE *state, int type,
101 cleanup_out_format(state, REC_TYPE_SIZE, REC_TYPE_SIZE_FORMAT,
112 state->action = cleanup_envelope_process;
113 cleanup_envelope_process(state, type, str, len);
118 static void cleanup_envelope_process(CLEANUP_STATE *state, int type,
144 state->queue_id, extra_opts);
146 state->flags |= extra_opts;
154 msg_warn("%s: ignoring bad delay time: %s", state->queue_id, buf);
156 state->defer_delay = defer_delay;
163 * zero (for example, all filters are in ACCEPT state, or the SMTP server
171 cleanup_milter_receive(state, milter_count);
182 vstring_strcpy(state->attr_buf, buf);
183 error_text = split_nameval(STR(state->attr_buf), &attr_name, &attr_value);
186 state->queue_id, error_text, buf);
187 state->errs |= CLEANUP_STAT_BAD;
193 state->queue_id, attr_name);
207 state->queue_id, type);
208 state->errs |= CLEANUP_STAT_BAD;
236 if ((state->flags & CLEANUP_FLAG_INRCPT) == 0
238 if (state->sender == 0) {
240 state->queue_id);
241 state->errs |= CLEANUP_STAT_BAD;
244 if (state->arrival_time.tv_sec == 0) {
246 state->queue_id);
247 state->errs |= CLEANUP_STAT_BAD;
255 if ((state->flags & CLEANUP_FLAG_WARN_SEEN) == 0
256 && state->sender && *state->sender
258 cleanup_out_format(state, REC_TYPE_WARN, REC_TYPE_WARN_FORMAT,
259 REC_TYPE_WARN_ARG(state->arrival_time.tv_sec
262 state->flags |= CLEANUP_FLAG_INRCPT;
269 if (state->sender == 0) { /* protect showq */
271 state->queue_id);
272 state->errs |= CLEANUP_STAT_BAD;
275 if (state->orig_rcpt == 0)
276 state->orig_rcpt = mystrdup(buf);
277 cleanup_addr_recipient(state, buf);
279 && state->milters == 0
280 && CLEANUP_MILTER_OK(state))
281 cleanup_milter_emul_rcpt(state, cleanup_milters, state->recip);
282 myfree(state->orig_rcpt);
283 state->orig_rcpt = 0;
284 if (state->dsn_orcpt != 0) {
285 myfree(state->dsn_orcpt);
286 state->dsn_orcpt = 0;
288 state->dsn_notify = 0;
292 if (state->orig_rcpt != 0) {
293 myfree(state->orig_rcpt);
294 state->orig_rcpt = 0;
296 if (state->dsn_orcpt != 0) {
297 myfree(state->dsn_orcpt);
298 state->dsn_orcpt = 0;
300 state->dsn_notify = 0;
304 if (state->dsn_orcpt) {
306 state->queue_id, state->dsn_orcpt);
307 myfree(state->dsn_orcpt);
309 state->dsn_orcpt = mystrdup(mapped_buf);
313 if (state->dsn_notify) {
315 state->queue_id, state->dsn_notify);
316 state->dsn_notify = 0;
321 state->queue_id, buf);
323 state->qmgr_opts |=
324 QMGR_READ_FLAG_FROM_DSN(state->dsn_notify = junk);
328 if (state->orig_rcpt != 0) {
330 state->queue_id, state->orig_rcpt);
331 myfree(state->orig_rcpt);
333 state->orig_rcpt = mystrdup(buf);
337 state->action = cleanup_message;
338 if (state->flags & CLEANUP_FLAG_INRCPT) {
339 if (state->milters || cleanup_milters) {
341 if ((state->append_rcpt_pt_offset = vstream_ftell(state->dst)) < 0)
343 cleanup_out_format(state, REC_TYPE_PTR, REC_TYPE_PTR_FORMAT, 0L);
344 if ((state->append_rcpt_pt_target = vstream_ftell(state->dst)) < 0)
347 state->flags &= ~CLEANUP_FLAG_INRCPT;
358 if (state->flags & CLEANUP_FLAG_INRCPT)
360 state->qmgr_opts |= QMGR_READ_FLAG_MIXED_RCPT_OTHER;
363 (void) sscanf(buf, "%*s $*s %*s %*s %*s %d", &state->smtputf8);
364 state->smtputf8 &= SMTPUTF8_FLAG_REQUESTED;
372 if (state->arrival_time.tv_sec == 0) {
373 REC_TYPE_TIME_SCAN(buf, state->arrival_time);
374 cleanup_out(state, type, buf, len);
377 cleanup_out_format(state, REC_TYPE_ATTR, "%s=%ld",
383 if (state->fullname == 0) {
384 state->fullname = mystrdup(buf);
385 cleanup_out(state, type, buf, len);
393 if (state->sender != 0) {
395 state->queue_id);
396 state->errs |= CLEANUP_STAT_BAD;
399 if (state->milters || cleanup_milters) {
401 if ((state->sender_pt_offset = vstream_ftell(state->dst)) < 0)
404 after_sender_offs = cleanup_addr_sender(state, buf);
405 if (state->milters || cleanup_milters) {
407 state->sender_pt_target = after_sender_offs;
410 && state->milters == 0
411 && CLEANUP_MILTER_OK(state))
412 cleanup_milter_emul_mail(state, cleanup_milters, state->sender);
419 state->queue_id);
420 state->errs |= CLEANUP_STAT_BAD;
423 if (state->dsn_envid != 0)
424 myfree(state->dsn_envid);
425 state->dsn_envid = mystrdup(mapped_buf);
426 cleanup_out(state, type, buf, len);
434 state->queue_id, buf);
435 state->errs |= CLEANUP_STAT_BAD;
438 state->dsn_ret = junk;
439 cleanup_out(state, type, buf, len);
444 if ((state->flags & CLEANUP_FLAG_WARN_SEEN) == 0) {
445 state->flags |= CLEANUP_FLAG_WARN_SEEN;
446 cleanup_out(state, type, buf, len);
452 if (state->verp_delims == 0) {
453 if (state->sender == 0 || state->sender[0] == 0) {
455 state->queue_id);
458 state->queue_id, buf);
460 state->verp_delims = mystrdup(buf);
461 cleanup_out(state, type, buf, len);
467 if (state->attr->used >= var_qattr_count_limit) {
469 state->queue_id, var_qattr_count_limit);
470 state->errs |= CLEANUP_STAT_BAD;
476 state->hdr_rewrite_context = MAIL_ATTR_RWR_LOCAL;
478 state->hdr_rewrite_context =
482 state->queue_id, attr_value);
483 state->errs |= CLEANUP_STAT_BAD;
490 state->queue_id, buf);
491 state->errs |= CLEANUP_STAT_BAD;
494 if (state->tflags == 0)
495 state->tflags = DEL_REQ_TRACE_FLAGS(atoi(attr_value));
497 nvtable_update(state->attr, attr_name, attr_value);
498 cleanup_out(state, type, buf, len);
501 cleanup_out(state, type, buf, len);