aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2019-12-21 11:35:24 +0100
committerGilles Chehade <gilles@poolp.org>2019-12-21 11:35:24 +0100
commite04911b52a76e60ff82312b8d6b68315c57ce93d (patch)
treea1245b83cd7451477876a0aac349e2113c1ee539
parentsync (diff)
downloadOpenSMTPD-e04911b52a76e60ff82312b8d6b68315c57ce93d.tar.xz
OpenSMTPD-e04911b52a76e60ff82312b8d6b68315c57ce93d.zip
sync with openbsd
-rw-r--r--smtpd/mta.c3
-rw-r--r--smtpd/mta_session.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/smtpd/mta.c b/smtpd/mta.c
index 6fbff8e9..ea79e2dc 100644
--- a/smtpd/mta.c
+++ b/smtpd/mta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta.c,v 1.233 2019/12/18 07:57:51 gilles Exp $ */
+/* $OpenBSD: mta.c,v 1.234 2019/12/21 10:34:07 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -1768,6 +1768,7 @@ mta_relay(struct envelope *e, struct relayhost *relayh)
r = xcalloc(1, sizeof *r);
TAILQ_INIT(&r->tasks);
r->id = generate_uid();
+ r->dispatcher = dispatcher;
r->tls = key.tls;
r->flags = key.flags;
r->domain = key.domain;
diff --git a/smtpd/mta_session.c b/smtpd/mta_session.c
index 72969e0a..ef47e88e 100644
--- a/smtpd/mta_session.c
+++ b/smtpd/mta_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta_session.c,v 1.122 2019/09/20 17:46:05 gilles Exp $ */
+/* $OpenBSD: mta_session.c,v 1.123 2019/12/21 10:34:32 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -128,6 +128,7 @@ struct mta_session {
struct mta_task *task;
struct mta_envelope *currevp;
FILE *datafp;
+ size_t datalen;
size_t failures;
@@ -362,8 +363,10 @@ mta_free(struct mta_session *s)
if (s->task)
fatalx("current task should have been deleted already");
- if (s->datafp)
+ if (s->datafp) {
fclose(s->datafp);
+ s->datalen = 0;
+ }
free(s->helo);
relay = s->relay;
@@ -814,6 +817,7 @@ again:
if (s->datafp) {
fclose(s->datafp);
s->datafp = NULL;
+ s->datalen = 0;
}
mta_send(s, "RSET");
break;
@@ -1344,7 +1348,7 @@ mta_queue_data(struct mta_session *s)
break;
if (ln[len - 1] == '\n')
ln[len - 1] = '\0';
- io_xprintf(s->io, "%s%s\r\n", *ln == '.' ? "." : "", ln);
+ s->datalen += io_xprintf(s->io, "%s%s\r\n", *ln == '.' ? "." : "", ln);
}
free(ln);