diff options
author | Gilles Chehade <gilles@poolp.org> | 2014-11-05 20:59:15 +0100 |
---|---|---|
committer | Gilles Chehade <gilles@poolp.org> | 2014-11-05 20:59:15 +0100 |
commit | e1a8da3b0ca9b81a43e9411ae4effb1ee387c462 (patch) | |
tree | 1a052ff88fa3f2374a61c5dcccc06bd04c2ed871 | |
parent | Merge branch 'master' into portable (diff) | |
parent | do not attempt to rewrite from/to/cc headers in the enqueuer, this does not work right (diff) | |
download | OpenSMTPD-e1a8da3b0ca9b81a43e9411ae4effb1ee387c462.tar.xz OpenSMTPD-e1a8da3b0ca9b81a43e9411ae4effb1ee387c462.zip |
Merge branch 'master' into portableopensmtpd-201411052125p1
-rw-r--r-- | smtpd/enqueue.c | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/smtpd/enqueue.c b/smtpd/enqueue.c index cff859e6..6bca764b 100644 --- a/smtpd/enqueue.c +++ b/smtpd/enqueue.c @@ -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[]) { @@ -409,10 +367,7 @@ enqueue(int argc, char *argv[]) if (msg.saw_content_transfer_encoding || 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; |