diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-01-04 19:23:07 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-01-04 19:23:07 +0000 |
commit | c9518877927a0186312f27166fbce9cab69dad37 (patch) | |
tree | cd538d6c5745861a02072181ae860181221d6b78 | |
parent | 598b3b1d1fcd0391c87dd6d9984ec79a896a7ba6 (diff) |
fix bug where runner would expire message that is being delivered,
leading to double unlink on envelope file; ok gilles@
-rw-r--r-- | usr.sbin/smtpd/runner.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/smtpd/runner.c b/usr.sbin/smtpd/runner.c index 7b2f065f99e..40446e470d5 100644 --- a/usr.sbin/smtpd/runner.c +++ b/usr.sbin/smtpd/runner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: runner.c,v 1.12 2008/12/27 17:45:54 jacekm Exp $ */ +/* $OpenBSD: runner.c,v 1.13 2009/01/04 19:23:06 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -720,6 +720,9 @@ int runner_message_schedule(struct message *messagep, time_t tm) { time_t delay; + + if (messagep->flags & (F_MESSAGE_SCHEDULED|F_MESSAGE_PROCESSING)) + return 0; /* Batch has been in the queue for too long and expired */ if (tm - messagep->creation >= SMTPD_QUEUE_EXPIRY) { @@ -731,12 +734,6 @@ runner_message_schedule(struct message *messagep, time_t tm) messagep->flags |= F_MESSAGE_EXPIRED; return 0; } - - if ((messagep->flags & F_MESSAGE_SCHEDULED) != 0) - return 0; - - if ((messagep->flags & F_MESSAGE_PROCESSING) != 0) - return 0; if (messagep->lasttry == 0) return 1; |