diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2014-04-04 20:25:45 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2014-04-04 20:25:45 +0000 |
commit | 33b1013f864554568f49136fe0e3dacbd172161e (patch) | |
tree | 34e300af919e5ff442a1db14bf576ac08127e0b9 /usr.sbin/smtpd | |
parent | 9355bce588f0d32c1590389a46ee1ee85fb87efb (diff) |
fix header parsing issue in enqueuer leading to From: header being stripped
in some cases
ok eric@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/enqueue.c | 14 |
1 files changed, 9 insertions, 5 deletions
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 <henning@bulabula.org> @@ -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 |