aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2015-06-30 10:10:57 +0200
committerGilles Chehade <gilles@poolp.org>2015-06-30 10:13:29 +0200
commitf61f28267fecaf59c216ec35be92060fe98b14da (patch)
tree858ac05ad82da00ac3bab0ff72797f4f142ee7df
parentupdate banner version (diff)
downloadOpenSMTPD-opensmtpd-5.7.1.tar.xz
OpenSMTPD-opensmtpd-5.7.1.zip
fix show queue for systems where struct envelope exceeds lenght of max imsgopensmtpd-5.7.1
-rw-r--r--smtpd/queue.c6
-rw-r--r--smtpd/smtpctl.c10
2 files changed, 14 insertions, 2 deletions
diff --git a/smtpd/queue.c b/smtpd/queue.c
index 6759eeaa..d6ec6291 100644
--- a/smtpd/queue.c
+++ b/smtpd/queue.c
@@ -74,6 +74,7 @@ queue_imsg(struct mproc *p, struct imsg *imsg)
time_t nexttry;
size_t n_evp;
int fd, mta_ext, ret, v, flags, code;
+ char buf[sizeof(evp)];
memset(&bounce, 0, sizeof(struct delivery_bounce));
if (p->proc == PROC_PONY) {
@@ -328,8 +329,11 @@ queue_imsg(struct mproc *p, struct imsg *imsg)
*/
evp.lasttry = nexttry;
}
+
+ (void)memcpy(buf, &evp.id, sizeof evp.id);
+ envelope_dump_buffer(&evp, buf+8, sizeof(buf)-8);
m_compose(p_control, IMSG_CTL_LIST_ENVELOPES,
- imsg->hdr.peerid, 0, -1, &evp, sizeof evp);
+ imsg->hdr.peerid, 0, -1, buf, 8 + strlen(buf+8) + 1);
return;
}
}
diff --git a/smtpd/smtpctl.c b/smtpd/smtpctl.c
index 0f1d879b..2209e991 100644
--- a/smtpd/smtpctl.c
+++ b/smtpd/smtpctl.c
@@ -260,6 +260,9 @@ srv_iter_envelopes(uint32_t msgid, struct envelope *evp)
static uint32_t currmsgid = 0;
static uint64_t from = 0;
static int done = 0, need_send = 1, found;
+ char buf[sizeof(*evp)];
+ size_t buflen;
+ uint64_t evpid;
if (currmsgid != msgid) {
if (currmsgid != 0 && !done)
@@ -292,7 +295,12 @@ srv_iter_envelopes(uint32_t msgid, struct envelope *evp)
goto again;
}
- srv_read(evp, sizeof(*evp));
+ srv_read(&evpid, sizeof evpid);
+ buflen = rlen;
+ srv_read(buf, rlen);
+ envelope_load_buffer(evp, buf, buflen - 1);
+ evp->id = evpid;
+
srv_end();
from = evp->id + 1;
found++;