From 17f785b9a16567d83114be35e43909f144400de9 Mon Sep 17 00:00:00 2001 From: gilles Date: Wed, 13 May 2015 07:34:49 +0000 Subject: [PATCH] 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@ --- usr.sbin/smtpd/enqueue.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 @@ -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); -- 2.20.1