- 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.
This commit is contained in:
Markus Fischer 2002-06-02 23:39:59 +00:00
parent d497ca147e
commit 9a97d55647

View File

@ -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;