From 0078cb893f7e753d27d7e5e68d44d1a5c00e6432 Mon Sep 17 00:00:00 2001 From: Jacek Masiulaniec Date: Tue, 1 Jun 2010 14:21:53 +0000 Subject: Schedule newly arrived mail immediately, ie. place it at the beginning of the list of next items to try, or near the beginning if the schedule contains expired mail, which is of highest priority. --- usr.sbin/smtpd/queue.c | 5 ++--- usr.sbin/smtpd/smtpd.h | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c index fb54886a95b..6e159950f18 100644 --- a/usr.sbin/smtpd/queue.c +++ b/usr.sbin/smtpd/queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.c,v 1.83 2010/06/01 11:27:07 jacekm Exp $ */ +/* $OpenBSD: queue.c,v 1.84 2010/06/01 14:21:52 jacekm Exp $ */ /* * Copyright (c) 2008-2010 Jacek Masiulaniec @@ -180,7 +180,7 @@ queue_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg) batch = realloc(batch, sizeof *batch); if (batch == NULL) fatal(NULL); - batch->retry = now; + batch->retry = RETRY_NOW; queue_schedule(rq, batch); } } @@ -491,7 +491,6 @@ batch_it(struct incoming *s, char *sortkey) if (batch == NULL) return NULL; SLIST_INIT(&batch->actions); - batch->retry = 0; batch->content = s->content; strlcpy(batch->sortkey, sortkey, batch_sz - sizeof *batch); SLIST_INSERT_HEAD(&s->batches[rq], batch, entry); diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index ddb66c75ee3..85fc2d5a917 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.188 2010/05/31 23:50:28 jacekm Exp $ */ +/* $OpenBSD: smtpd.h,v 1.189 2010/06/01 14:21:52 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -385,6 +385,7 @@ struct content { }; #define NO_RETRY_EXPIRED 0 +#define RETRY_NOW 1 struct batch { SLIST_ENTRY(batch) entry; -- cgit v1.2.3