From 9a97d55647dfcde9d814ac056945182d18965a79 Mon Sep 17 00:00:00 2001 From: Markus Fischer Date: Sun, 2 Jun 2002 23:39:59 +0000 Subject: - Only add the To: field with the $to parameter if we don't have it in the custom header. This was the behaviour < 4.2.x (but it was broken, this one isn't). # last commit for today, promised. --- win32/sendmail.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'win32/sendmail.c') diff --git a/win32/sendmail.c b/win32/sendmail.c index 28d26d23d0..4266aa7509 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -545,9 +545,14 @@ int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders, char *m if (!addToHeader(&header_buffer, "Subject: %s\r\n", Subject)) { goto PostHeader_outofmem; } - if (!addToHeader(&header_buffer, "To: %s\r\n", mailTo)) { - goto PostHeader_outofmem; + + /* Only add the To: field from the $to parameter if isn't in the custom headers */ + if ((headers_lc && (!strstr(headers_lc, "\r\nto:") && (strncmp(headers_lc, "to:", 3) != 0))) || !headers_lc) { + if (!addToHeader(&header_buffer, "To: %s\r\n", mailTo)) { + goto PostHeader_outofmem; + } } + if (mailCc && *mailCc) { if (!addToHeader(&header_buffer, "Cc: %s\r\n", mailCc)) { goto PostHeader_outofmem; -- cgit v1.2.1