summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2015-05-13 07:34:49 +0000
committergilles <gilles@openbsd.org>2015-05-13 07:34:49 +0000
commit17f785b9a16567d83114be35e43909f144400de9 (patch)
treec2b000da9624c0d60720671cf541795b332e7f66
parentDefine END() to set ELF symbol size. (diff)
downloadwireguard-openbsd-17f785b9a16567d83114be35e43909f144400de9.tar.xz
wireguard-openbsd-17f785b9a16567d83114be35e43909f144400de9.zip
The enqueuer should never encouter the "From " separator in its headers, as
it is added by the mda. If it sees one, it means that the enqueuer was used as the mda and it needs to strip it otherwise the message will end with two delimiters later down the road. Same applies to "Return-Path". bug experienced by James Turner, confirmed by Giovanni. fix suggested by Todd Miller, diff ok eric@
-rw-r--r--usr.sbin/smtpd/enqueue.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/enqueue.c b/usr.sbin/smtpd/enqueue.c
index 761af40be98..c7dd6c9224e 100644
--- a/usr.sbin/smtpd/enqueue.c
+++ b/usr.sbin/smtpd/enqueue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: enqueue.c,v 1.93 2015/05/03 18:10:58 gilles Exp $ */
+/* $OpenBSD: enqueue.c,v 1.94 2015/05/13 07:34:49 gilles Exp $ */
/*
* Copyright (c) 2005 Henning Brauer <henning@bulabula.org>
@@ -388,6 +388,13 @@ enqueue(int argc, char *argv[])
line = buf;
+ if (inheaders) {
+ if (strncasecmp("from ", line, 5) == 0)
+ continue;
+ if (strncasecmp("return-path: ", line, 13) == 0)
+ continue;
+ }
+
if (msg.saw_content_transfer_encoding || msg.noheader ||
inheaders || !msg.need_linesplit) {
send_line(fout, 0, "%.*s", (int)len, line);