From aae7d916d860cc4ad9d379d122066f0727313465 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Sun, 12 Apr 2009 15:42:14 +0000 Subject: When runner_check_loop() detects a mail loop, remove the envelope. This is only half of the problem solved, we need to generate a mailer daemon too. This fixes a bug in my smtpd where it would try to schedule a message, detect that it is a loop and not schedule it, then trying again at next queue walk ... --- usr.sbin/smtpd/runner.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/smtpd/runner.c b/usr.sbin/smtpd/runner.c index 92023e7a788..e01c96b34de 100644 --- a/usr.sbin/smtpd/runner.c +++ b/usr.sbin/smtpd/runner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: runner.c,v 1.38 2009/03/29 14:18:20 jacekm Exp $ */ +/* $OpenBSD: runner.c,v 1.39 2009/04/12 15:42:13 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -528,7 +528,11 @@ runner_process_queue(struct smtpd *env) if (! runner_message_schedule(&message, now)) continue; - runner_check_loop(&message); + if (runner_check_loop(&message)) { + log_debug("TODO: generate mailer daemon"); + queue_remove_envelope(&message); + continue; + } message.flags |= F_MESSAGE_SCHEDULED; message.flags &= ~F_MESSAGE_FORCESCHEDULE; -- cgit v1.2.3