cvs: php4 /win32 sendmail.c
| From: | Frank M. Kromann | Date: | Tue, 02 Jul 2002 23:44:06 +0000 |
| Subject: | cvs: php4 /win32 sendmail.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12674@lists.php.net to get a copy of this message | ||
fmk Tue Jul 2 19:44:06 2002 EDT
Modified files:
/php4/win32 sendmail.c
Log:
Oops. Last commit reverted some of sebastians changes.
Index: php4/win32/sendmail.c
diff -u php4/win32/sendmail.c:1.45 php4/win32/sendmail.c:1.46
--- php4/win32/sendmail.c:1.45 Tue Jul 2 18:29:13 2002
+++ php4/win32/sendmail.c Tue Jul 2 19:44:06 2002
@@ -17,7 +17,7 @@
*
*/
-/* $Id: sendmail.c,v 1.45 2002/07/02 22:29:13 fmk Exp $ */
+/* $Id: sendmail.c,v 1.46 2002/07/02 23:44:06 fmk Exp $ */
#include "php.h" /*php specific */
#include <stdio.h>
@@ -56,10 +56,12 @@
response is ecalloc()d in Ack() itself and efree()d here
because the content is in *error_message now */
#define SMTP_ERROR_RESPONSE(response) { \
- if (NULL != (*error_message = ecalloc(1, sizeof(SMTP_ERROR_RESPONSE_SPEC) +
strlen(response)))) { \
- snprintf(*error_message, sizeof(SMTP_ERROR_RESPONSE_SPEC) + strlen(response),
SMTP_ERROR_RESPONSE_SPEC, response); \
+ if (response && error_message) { \
+ if (NULL != (*error_message = ecalloc(1, sizeof(SMTP_ERROR_RESPONSE_SPEC) +
strlen(response)))) { \
+ snprintf(*error_message, sizeof(SMTP_ERROR_RESPONSE_SPEC) + strlen(response),
SMTP_ERROR_RESPONSE_SPEC, response); \
+ } \
+ efree(response); \
} \
- efree(response); \
}
#ifndef THREAD_SAFE
@@ -393,7 +395,6 @@
return W32_SM_SENDMAIL_FROM_MALFORMED;
}
-
tempMailTo = estrdup(mailTo);
/* Send mail to all rcpt's */
token = strtok(tempMailTo, ",");
@@ -431,14 +432,11 @@
token = strtok(tempMailTo, ",");
while(token != NULL)
{
- snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);
- if ((res = Post(Buffer)) != SUCCESS) {
- efree(tempMailTo);
+ sprintf(Buffer, "RCPT TO:<%s>\r\n", token);
+ if ((res = Post(Buffer)) != SUCCESS)
return (res);
- }
if ((res = Ack(&server_response)) != SUCCESS) {
SMTP_ERROR_RESPONSE(server_response);
- efree(tempMailTo);
return (res);
}
token = strtok(NULL, ",");
@@ -527,6 +525,7 @@
}
}
}
+
if (mailBcc && *mailBcc) {
tempMailTo = estrdup(mailBcc);
/* Send mail to all rcpt's */
@@ -695,7 +694,7 @@
}
}
if(xheaders){
- if (!addToHeader(&header_buffer, "%s", xheaders)) {
+ if (!addToHeader(&header_buffer, "%s\r\n", xheaders)) {
goto PostHeader_outofmem;
}
}