summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2015-11-30 13:10:14 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2015-11-30 13:10:14 +0000
commitf5ec422783f1eca5928b0c6acdfd53568dcab9ee (patch)
tree27f964c3ea66aa6db058a20839b88ab7f97aca97 /usr.sbin
parent485094b0c9cc99e64d09270763d6d598a1163206 (diff)
handle "mda command too long" as a tempfail
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/mda.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/mda.c b/usr.sbin/smtpd/mda.c
index 0d6d38823d9..606c42e2d4c 100644
--- a/usr.sbin/smtpd/mda.c
+++ b/usr.sbin/smtpd/mda.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mda.c,v 1.113 2015/11/30 12:26:55 sunil Exp $ */
+/* $OpenBSD: mda.c,v 1.114 2015/11/30 13:10:13 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -281,8 +281,17 @@ mda_imsg(struct mproc *p, struct imsg *imsg)
deliver.userinfo = *userinfo;
(void)strlcpy(deliver.user, userinfo->username,
sizeof(deliver.user));
- (void)strlcpy(deliver.to, e->buffer,
- sizeof(deliver.to));
+ if (strlcpy(deliver.to, e->buffer,
+ sizeof(deliver.to))
+ >= sizeof(deliver.to)) {
+ mda_queue_tempfail(e->id,
+ "mda command too long",
+ ESC_OTHER_MAIL_SYSTEM_STATUS);
+ mda_log(e, "TempFail",
+ "mda command too long");
+ mda_done(s);
+ return;
+ }
break;
case A_MBOX: