summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-08-18 18:38:06 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-08-18 18:38:06 +0000
commit1970df07db36ee4aa2bad24405fcf4d997eafd39 (patch)
tree5bd55ed2cc6b3572ece55d270b46455bcec00c5c /usr.sbin
parent3ec7696d778dc318faa2c92e511b7b4fd3adc131 (diff)
The end of headers check that is used to determine where to insert our
Delivered-To header was wrong and could eventually lead to smtpd adding it too early and making the remaining headers appear as body part to MUAs. issue reported by Mathieu Goessens <gebura@poolp.org>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/store.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/store.c b/usr.sbin/smtpd/store.c
index 3c9f32ec531..3e0ba7ce19f 100644
--- a/usr.sbin/smtpd/store.c
+++ b/usr.sbin/smtpd/store.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: store.c,v 1.25 2009/08/08 00:02:22 gilles Exp $ */
+/* $OpenBSD: store.c,v 1.26 2009/08/18 18:38:05 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -66,7 +66,9 @@ file_copy(FILE *dest, FILE *src, struct path *path, enum action_type type, int s
* add the Delivered-To header to help loop detection.
*/
if (!session && path != NULL && inheaders &&
- strchr(buf, ':') == NULL && !isspace((int)*buf)) {
+ (*buf == '\0' ||
+ (!isspace((int)*buf) &&
+ strchr(buf, ':') == NULL))) {
if (fprintf(dest, "Delivered-To: %s@%s\n",
path->user, path->domain) == -1)
return 0;