summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2011-04-15 19:03:29 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2011-04-15 19:03:29 +0000
commit54d01755e0c490f3abfc0ae79a651eac257ad0cf (patch)
treea48a562c28d92c7f795012a343bb796b4426ca0c /usr.sbin
parentbced12227a856cca6772e3e48ee4ecbbed7296a5 (diff)
whenever an envelope is reinserted into the ramqueue after a trip to mda or
mta, call runner_reset_events() so runner starts reprocessing ramqueue
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/runner.c21
-rw-r--r--usr.sbin/smtpd/smtpd.h5
2 files changed, 17 insertions, 9 deletions
diff --git a/usr.sbin/smtpd/runner.c b/usr.sbin/smtpd/runner.c
index 013bfda8b57..cf4844bb384 100644
--- a/usr.sbin/smtpd/runner.c
+++ b/usr.sbin/smtpd/runner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: runner.c,v 1.102 2011/04/15 17:01:05 gilles Exp $ */
+/* $OpenBSD: runner.c,v 1.103 2011/04/15 19:03:28 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -46,6 +46,7 @@ void runner_imsg(struct smtpd *, struct imsgev *, struct imsg *);
__dead void runner_shutdown(void);
void runner_sig_handler(int, short, void *);
void runner_setup_events(struct smtpd *);
+void runner_reset_events(struct smtpd *);
void runner_disable_events(struct smtpd *);
void runner_timeout(int, short, void *);
@@ -76,7 +77,7 @@ runner_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg)
case IMSG_QUEUE_COMMIT_MESSAGE:
m = imsg->data;
runner_force_message_to_ramqueue(&env->sc_rqueue, m->evpid>>32);
- runner_setup_events(env);
+ runner_reset_events(env);
return;
case IMSG_QUEUE_MESSAGE_UPDATE:
@@ -91,7 +92,7 @@ runner_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg)
m->status &= ~S_MESSAGE_TEMPFAILURE;
queue_envelope_update(env, Q_QUEUE, m);
ramqueue_insert(&env->sc_rqueue, m, time(NULL));
- runner_setup_events(env);
+ runner_reset_events(env);
return;
}
@@ -105,7 +106,7 @@ runner_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg)
m->sender.user[0] != '\0') {
bounce_record_message(env, m, &bounce);
ramqueue_insert(&env->sc_rqueue, &bounce, time(NULL));
- runner_setup_events(env);
+ runner_reset_events(env);
}
}
@@ -133,7 +134,7 @@ runner_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg)
m->status = 0;
queue_envelope_update(env, Q_QUEUE, m);
ramqueue_insert(&env->sc_rqueue, m, time(NULL));
- runner_setup_events(env);
+ runner_reset_events(env);
return;
}
return;
@@ -194,6 +195,16 @@ runner_setup_events(struct smtpd *env)
}
void
+runner_reset_events(struct smtpd *env)
+{
+ struct timeval tv;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 10;
+ evtimer_add(&env->sc_ev, &tv);
+}
+
+void
runner_disable_events(struct smtpd *env)
{
evtimer_del(&env->sc_ev);
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h
index 62e2d651ab0..66947d6446e 100644
--- a/usr.sbin/smtpd/smtpd.h
+++ b/usr.sbin/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.214 2011/04/15 17:01:05 gilles Exp $ */
+/* $OpenBSD: smtpd.h,v 1.215 2011/04/15 19:03:28 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -442,9 +442,6 @@ struct message {
char tag[MAX_TAG_SIZE];
u_int64_t evpid;
-// char message_id[MAX_ID_SIZE];
-// char message_uid[MAX_ID_SIZE];
-
char session_helo[MAXHOSTNAMELEN];
char session_hostname[MAXHOSTNAMELEN];
char session_errorline[MAX_LINE_SIZE];