summaryrefslogtreecommitdiffstats
path: root/usr.sbin/smtpd/queue_backend.c
diff options
context:
space:
mode:
authorsunil <sunil@openbsd.org>2015-11-05 09:14:31 +0000
committersunil <sunil@openbsd.org>2015-11-05 09:14:31 +0000
commitd05af802c82022e40b2b220b4c42e85cbc9a596e (patch)
tree0877be9bb61a4a20427879e37681111d29e014da /usr.sbin/smtpd/queue_backend.c
parentDo not terminate message walk on a corrupt envelope. (diff)
downloadwireguard-openbsd-d05af802c82022e40b2b220b4c42e85cbc9a596e.tar.xz
wireguard-openbsd-d05af802c82022e40b2b220b4c42e85cbc9a596e.zip
Implement smtpctl uncorrupt <msgid>
"uncorrupt" moves envelopes from corrupt bucket back to the queue for further discovery by the daemon. After correcting the corrupt envelopes, admin could now... # smtpctl uncorrupt msgid # smtpctl discover msgid to schedule the messages. Ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/queue_backend.c')
-rw-r--r--usr.sbin/smtpd/queue_backend.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/queue_backend.c b/usr.sbin/smtpd/queue_backend.c
index 590f6c888af..21e704527af 100644
--- a/usr.sbin/smtpd/queue_backend.c
+++ b/usr.sbin/smtpd/queue_backend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue_backend.c,v 1.58 2015/11/05 08:59:23 sunil Exp $ */
+/* $OpenBSD: queue_backend.c,v 1.59 2015/11/05 09:14:31 sunil Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@poolp.org>
@@ -65,6 +65,7 @@ static int (*handler_message_commit)(uint32_t, const char*);
static int (*handler_message_delete)(uint32_t);
static int (*handler_message_fd_r)(uint32_t);
static int (*handler_message_corrupt)(uint32_t);
+static int (*handler_message_uncorrupt)(uint32_t);
static int (*handler_envelope_create)(uint32_t, const char *, size_t, uint64_t *);
static int (*handler_envelope_delete)(uint64_t);
static int (*handler_envelope_update)(uint64_t, const char *, size_t);
@@ -298,6 +299,12 @@ queue_message_corrupt(uint32_t msgid)
}
int
+queue_message_uncorrupt(uint32_t msgid)
+{
+ return handler_message_uncorrupt(msgid);
+}
+
+int
queue_message_fd_r(uint32_t msgid)
{
int fdin = -1, fdout = -1, fd = -1;
@@ -780,6 +787,12 @@ queue_api_on_message_corrupt(int(*cb)(uint32_t))
}
void
+queue_api_on_message_uncorrupt(int(*cb)(uint32_t))
+{
+ handler_message_uncorrupt = cb;
+}
+
+void
queue_api_on_envelope_create(int(*cb)(uint32_t, const char *, size_t, uint64_t *))
{
handler_envelope_create = cb;