diff options
author | Frank M. Kromann <fmk@php.net> | 2002-11-30 21:50:17 +0000 |
---|---|---|
committer | Frank M. Kromann <fmk@php.net> | 2002-11-30 21:50:17 +0000 |
commit | 32d7284c52ff12549e5aef5b0a114cd9803c174a (patch) | |
tree | 93d5c5b2f297d51b3a365428330c21fc21ef06f8 | |
parent | 7afd92792b557bb95f59d4cf7e75dc87cf6ff0b0 (diff) | |
download | php-git-32d7284c52ff12549e5aef5b0a114cd9803c174a.tar.gz |
Dont scan headers for cc abd bcc if extra parameters are used for these
-rw-r--r-- | win32/sendmail.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c index 8e4581595e..d98ce3c768 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -414,8 +414,28 @@ int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailB } efree(tempMailTo); + if (mailCc && *mailCc) { + tempMailTo = estrdup(mailCc); + /* Send mail to all rcpt's */ + token = strtok(tempMailTo, ","); + while(token != NULL) + { + snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token); + if ((res = Post(Buffer)) != SUCCESS) { + efree(tempMailTo); + return (res); + } + if ((res = Ack(&server_response)) != SUCCESS) { + SMTP_ERROR_RESPONSE(server_response); + efree(tempMailTo); + return (res); + } + token = strtok(NULL, ","); + } + efree(tempMailTo); + } /* Send mail to all Cc rcpt's */ - if (headers && (pos1 = strstr(headers_lc, "cc:"))) { + else if (headers && (pos1 = strstr(headers_lc, "cc:"))) { /* Real offset is memaddress from the original headers + difference of * string found in the lowercase headrs + 3 characters to jump over * the cc: */ @@ -444,8 +464,11 @@ int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailB efree(tempMailTo); } - if (mailCc && *mailCc) { - tempMailTo = estrdup(mailCc); + /* Send mail to all Bcc rcpt's + This is basically a rip of the Cc code above. + Just don't forget to remove the Bcc: from the header afterwards. */ + if (mailBcc && *mailBcc) { + tempMailTo = estrdup(mailBcc); /* Send mail to all rcpt's */ token = strtok(tempMailTo, ","); while(token != NULL) @@ -464,11 +487,7 @@ int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailB } efree(tempMailTo); } - - /* Send mail to all Bcc rcpt's - This is basically a rip of the Cc code above. - Just don't forget to remove the Bcc: from the header afterwards. */ - if (headers) { + else if (headers) { if (pos1 = strstr(headers_lc, "bcc:")) { /* Real offset is memaddress from the original headers + difference of * string found in the lowercase headrs + 4 characters to jump over @@ -526,27 +545,6 @@ int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailB } } - if (mailBcc && *mailBcc) { - tempMailTo = estrdup(mailBcc); - /* Send mail to all rcpt's */ - token = strtok(tempMailTo, ","); - while(token != NULL) - { - snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) { - efree(tempMailTo); - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - efree(tempMailTo); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - } - if ((res = Post("DATA\r\n")) != SUCCESS) { efree(stripped_header); return (res); |