fmk             Fri Dec  6 17:56:57 2002 EDT

  Modified files:              
    /php4/win32 sendmail.c sendmail.h 
  Log:
  Removing unused code and making sure headers are send when called from imap_mail()
  
  
Index: php4/win32/sendmail.c
diff -u php4/win32/sendmail.c:1.48 php4/win32/sendmail.c:1.49
--- php4/win32/sendmail.c:1.48  Sat Nov 30 16:50:17 2002
+++ php4/win32/sendmail.c       Fri Dec  6 17:56:57 2002
@@ -17,7 +17,7 @@
  *
  */
 
-/* $Id: sendmail.c,v 1.48 2002/11/30 21:50:17 fmk Exp $ */
+/* $Id: sendmail.c,v 1.49 2002/12/06 22:56:57 fmk Exp $ */
 
 #include "php.h"                               /*php specific */
 #include <stdio.h>
@@ -536,12 +536,14 @@
                                   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 @@
                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 @@
                return (res);
        }
 
-
        /* send message contents in 1024 chunks */
        if (strlen(data) <= 1024) {
                if ((res = Post(data)) != SUCCESS)
@@ -620,13 +620,12 @@
 //              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 */
@@ -683,12 +682,6 @@
        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;
                }
        }
        if(xheaders){
Index: php4/win32/sendmail.h
diff -u php4/win32/sendmail.h:1.10 php4/win32/sendmail.h:1.11
--- php4/win32/sendmail.h:1.10  Tue Jul  2 18:29:13 2002
+++ php4/win32/sendmail.h       Fri Dec  6 17:56:57 2002
@@ -41,7 +41,7 @@
 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);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to