summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2014-11-06 08:55:07 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2014-11-06 08:55:07 +0000
commit73c6b33a5effbd7367ba73000634be270ade678e (patch)
treea2c2481064a817f3367b06aac44c59d042918a57 /usr.sbin/smtpd
parent8658d16d7af6411bbfb7657376907b2c65801d24 (diff)
since domain appending is handled at the daemon level, don't try to do it
in the enqueuer itself, it leads to broken headers
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/enqueue.c49
1 files changed, 2 insertions, 47 deletions
diff --git a/usr.sbin/smtpd/enqueue.c b/usr.sbin/smtpd/enqueue.c
index 00ca3bc8ba1..451fa25d65f 100644
--- a/usr.sbin/smtpd/enqueue.c
+++ b/usr.sbin/smtpd/enqueue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: enqueue.c,v 1.86 2014/10/26 11:26:08 gilles Exp $ */
+/* $OpenBSD: enqueue.c,v 1.87 2014/11/06 08:55:06 gilles Exp $ */
/*
* Copyright (c) 2005 Henning Brauer <henning@bulabula.org>
@@ -161,48 +161,6 @@ qp_encoded_write(FILE *fp, char *buf, size_t len)
}
}
-static void
-send_header(FILE *fout, const char *line, size_t len)
-{
- int i;
-
- if (strncasecmp("To:", line, 3) != 0 &&
- strncasecmp("Cc:", line, 3) != 0 &&
- strncasecmp("Bcc:", line, 4) != 0 &&
- strncasecmp("From:", line, 5) != 0) {
- send_line(fout, 0, "%.*s", (int)len, line);
- return;
- }
- if (len >= sizeof pstate.buf) {
- send_line(fout, 0, "%.*s", (int)len, line);
- return;
- }
-
- /* XXX
- * To, Cc and Bcc may need rewrite, we can reuse the
- * msg recipients field since former content has already
- * been used at this point.
- */
- memset(&pstate, 0, sizeof(pstate));
- memcpy(pstate.buf, line, len);
- pstate.buf[len] = 0;
- pstate.wpos = len - 1;
- msg.rcpts = NULL;
- msg.rcpt_cnt = 0;
-
- if (strncasecmp("From:", line, 5) == 0) {
- parse_addr_terminal(1);
- send_line(fout, 0, "%s\n", msg.from);
- }
- else {
- parse_addr_terminal(0);
- for (i = 0; i < msg.rcpt_cnt; ++i)
- if (*msg.rcpts[i] != '\0')
- send_line(fout, 0, "%s%s%s\n", i > 0 ? "\t" : "",
- msg.rcpts[i], i < msg.rcpt_cnt - 1 ? "," : "");
- }
-}
-
int
enqueue(int argc, char *argv[])
{
@@ -414,10 +372,7 @@ enqueue(int argc, char *argv[])
if (msg.saw_content_transfer_encoding || msg.noheader ||
inheaders || !msg.need_linesplit) {
- if (inheaders)
- send_header(fout, line, len);
- else
- send_line(fout, 0, "%.*s", (int)len, line);
+ send_line(fout, 0, "%.*s", (int)len, line);
if (inheaders && buf[0] == '\n')
inheaders = 0;
continue;