summaryrefslogtreecommitdiff
path: root/win32/sendmail.c
diff options
context:
space:
mode:
authorFrank M. Kromann <fmk@php.net>2002-12-06 22:56:57 +0000
committerFrank M. Kromann <fmk@php.net>2002-12-06 22:56:57 +0000
commitac2f1624d7398a57a61885202ff0dbb1c0bf3ca1 (patch)
treeea310dd5ff7c5ce3d469eb503fce937c17a96462 /win32/sendmail.c
parent0d812352be41478085bdc18cd5fb9dc5fcfd5297 (diff)
downloadphp-git-ac2f1624d7398a57a61885202ff0dbb1c0bf3ca1.tar.gz
Removing unused code and making sure headers are send when called from imap_mail()
Diffstat (limited to 'win32/sendmail.c')
-rw-r--r--win32/sendmail.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c
index d98ce3c768..5a8c7276d3 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -536,12 +536,14 @@ int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailB
which would look like "\r\n\r\n". */
memcpy(stripped_header + (pos1 - headers - 4), pos2 + 2, strlen(pos2) - 2);
}
- } else {
- /* Simplify the code that we create a copy of stripped_header no matter if
- we actually strip something or not. So we've a single efree() later. */
- if (NULL == (stripped_header = estrndup(headers, strlen(headers)))) {
- return OUT_OF_MEMORY;
- }
+ }
+ }
+
+ /* Simplify the code that we create a copy of stripped_header no matter if
+ we actually strip something or not. So we've a single efree() later. */
+ if (headers && !stripped_header) {
+ if (NULL == (stripped_header = estrndup(headers, strlen(headers)))) {
+ return OUT_OF_MEMORY;
}
}
@@ -555,12 +557,11 @@ int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailB
return (res);
}
-
/* send message header */
if (Subject == NULL) {
- res = PostHeader(RPath, "No Subject", mailTo, stripped_header, NULL);
+ res = PostHeader(RPath, "No Subject", mailTo, stripped_header);
} else {
- res = PostHeader(RPath, Subject, mailTo, stripped_header, NULL);
+ res = PostHeader(RPath, Subject, mailTo, stripped_header);
}
if (stripped_header) {
efree(stripped_header);
@@ -569,7 +570,6 @@ int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailB
return (res);
}
-
/* send message contents in 1024 chunks */
if (strlen(data) <= 1024) {
if ((res = Post(data)) != SUCCESS)
@@ -620,13 +620,12 @@ int addToHeader(char **header_buffer, const char *specifier, char *string) {
// 2) Subject
// 3) destination address
// 4) headers
-// 5) cc destination address
// Output: Error code or Success
// Description:
// Author/Date: jcar 20/9/96
// History:
//********************************************************************/
-int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders, char *mailCc)
+int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders)
{
/* Print message header according to RFC 822 */
@@ -685,12 +684,6 @@ int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders, char *m
goto PostHeader_outofmem;
}
}
-
- if (mailCc && *mailCc) {
- if (!addToHeader(&header_buffer, "Cc: %s\r\n", mailCc)) {
- goto PostHeader_outofmem;
- }
- }
if(xheaders){
if (!addToHeader(&header_buffer, "%s\r\n", xheaders)) {
goto PostHeader_outofmem;