diff options
author | Frank M. Kromann <fmk@php.net> | 2002-12-06 22:56:57 +0000 |
---|---|---|
committer | Frank M. Kromann <fmk@php.net> | 2002-12-06 22:56:57 +0000 |
commit | ac2f1624d7398a57a61885202ff0dbb1c0bf3ca1 (patch) | |
tree | ea310dd5ff7c5ce3d469eb503fce937c17a96462 /win32 | |
parent | 0d812352be41478085bdc18cd5fb9dc5fcfd5297 (diff) | |
download | php-git-ac2f1624d7398a57a61885202ff0dbb1c0bf3ca1.tar.gz |
Removing unused code and making sure headers are send when called from imap_mail()
Diffstat (limited to 'win32')
-rw-r--r-- | win32/sendmail.c | 29 | ||||
-rw-r--r-- | win32/sendmail.h | 2 |
2 files changed, 12 insertions, 19 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; diff --git a/win32/sendmail.h b/win32/sendmail.h index 9282cc6cbc..751b9d6b34 100644 --- a/win32/sendmail.h +++ b/win32/sendmail.h @@ -41,7 +41,7 @@ int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailB char *GetSMErrorText(int index); int MailConnect(); -int PostHeader(char *, char *, char *, char *, char *); +int PostHeader(char *, char *, char *, char *); int Post(LPCSTR); int Ack(char **server_response); unsigned long GetAddr(LPSTR szHost); |