From 33b1013f864554568f49136fe0e3dacbd172161e Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Fri, 4 Apr 2014 20:25:45 +0000 Subject: fix header parsing issue in enqueuer leading to From: header being stripped in some cases ok eric@ --- usr.sbin/smtpd/enqueue.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'usr.sbin/smtpd') diff --git a/usr.sbin/smtpd/enqueue.c b/usr.sbin/smtpd/enqueue.c index b0797e918b3..d00e99b2874 100644 --- a/usr.sbin/smtpd/enqueue.c +++ b/usr.sbin/smtpd/enqueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: enqueue.c,v 1.78 2014/04/04 16:10:42 eric Exp $ */ +/* $OpenBSD: enqueue.c,v 1.79 2014/04/04 20:25:44 gilles Exp $ */ /* * Copyright (c) 2005 Henning Brauer @@ -187,12 +187,16 @@ send_header(FILE *fout, const char *line, size_t len) pstate.wpos = len - 1; msg.rcpts = NULL; msg.rcpt_cnt = 0; - if (strncasecmp("From:", line, 5) == 0) + + if (strncasecmp("From:", line, 5) == 0) { parse_addr_terminal(1); - else + send_line(fout, 0, "%s\n", msg.from); + } + else { parse_addr_terminal(0); - for (i = 0; i < msg.rcpt_cnt; ++i) - send_line(fout, 0, "%s%s\n", msg.rcpts[i], i < msg.rcpt_cnt - 1 ? "," : ""); + for (i = 0; i < msg.rcpt_cnt; ++i) + send_line(fout, 0, "%s%s\n", msg.rcpts[i], i < msg.rcpt_cnt - 1 ? "," : ""); + } } int -- cgit v1.2.3