summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/queue.c
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2013-07-19 21:14:53 +0000
committerEric Faurot <eric@cvs.openbsd.org>2013-07-19 21:14:53 +0000
commit89ca14ddb53440286ab2ed0c2b9e4473dda6d12e (patch)
treecf8744bfc84648a1c7489c187f08afd665f2dcaf /usr.sbin/smtpd/queue.c
parent012c74efba199a734b02042792ff1c3e8f7b4546 (diff)
Many MTA improvements:
- Better transient error handling logic: failing destinations are automatically disabled for a while. When a destination is active again, ask the scheduler to retry previous envelopes immediatly. - More informative error report when all routes fail for a mail. - Implement a "smtpctl show hoststats" command to get the latest stat message per MX domain. - Implement a "smtpctl show routes" command to show the state the currently known routes to remote MXs. - Implement a "smtpctl resume route" command to re-enable a route that has been disabled. - Do not hardcode limits - Minor code improvements
Diffstat (limited to 'usr.sbin/smtpd/queue.c')
-rw-r--r--usr.sbin/smtpd/queue.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c
index 177be1a7c38..d328979f5bd 100644
--- a/usr.sbin/smtpd/queue.c
+++ b/usr.sbin/smtpd/queue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue.c,v 1.152 2013/07/19 20:37:07 eric Exp $ */
+/* $OpenBSD: queue.c,v 1.153 2013/07/19 21:14:52 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -63,7 +63,6 @@ queue_imsg(struct mproc *p, struct imsg *imsg)
struct delivery_bounce bounce;
struct bounce_req_msg *req_bounce;
struct envelope evp;
- static uint64_t batch_id;
struct msg m;
const char *reason;
uint64_t reqid, evpid;
@@ -266,14 +265,7 @@ queue_imsg(struct mproc *p, struct imsg *imsg)
bounce_add(evpid);
return;
- case IMSG_MTA_BATCH:
- batch_id = generate_uid();
- m_create(p_mta, IMSG_MTA_BATCH, 0, 0, -1);
- m_add_id(p_mta, batch_id);
- m_close(p_mta);
- return;
-
- case IMSG_MTA_BATCH_ADD:
+ case IMSG_MTA_TRANSFER:
m_msg(&m, imsg);
m_get_evpid(&m, &evpid);
m_end(&m);
@@ -286,18 +278,11 @@ queue_imsg(struct mproc *p, struct imsg *imsg)
return;
}
evp.lasttry = time(NULL);
- m_create(p_mta, IMSG_MTA_BATCH_ADD, 0, 0, -1);
- m_add_id(p_mta, batch_id);
+ m_create(p_mta, IMSG_MTA_TRANSFER, 0, 0, -1);
m_add_envelope(p_mta, &evp);
m_close(p_mta);
return;
- case IMSG_MTA_BATCH_END:
- m_create(p_mta, IMSG_MTA_BATCH_END, 0, 0, -1);
- m_add_id(p_mta, batch_id);
- m_close(p_mta);
- return;
-
case IMSG_CTL_LIST_ENVELOPES:
if (imsg->hdr.len == sizeof imsg->hdr) {
m_forward(p_control, imsg);