]> git.pld-linux.org Git - packages/php.git/blame - php-mail.patch
- release 1.2 ro rebuild with new imap
[packages/php.git] / php-mail.patch
CommitLineData
84a06529 1--- php-4.3.0/ext/standard/mail.c.orig Fri Nov 29 12:15:43 2002
2+++ php-4.3.0/ext/standard/mail.c Thu Jan 2 12:37:54 2003
3@@ -21,6 +21,8 @@
4 #include <stdlib.h>
5 #include <ctype.h>
6 #include <stdio.h>
7+#include <syslog.h>
8+#include <string.h>
9 #include "php.h"
10 #include "ext/standard/info.h"
11
12@@ -36,6 +38,9 @@
13 #include "safe_mode.h"
14 #include "exec.h"
15
16+#include "zend_operators.h"
17+#include "zend_globals.h"
18+
19 #if HAVE_SENDMAIL
20 #ifdef PHP_WIN32
21 #include "win32/sendmail.h"
22@@ -196,8 +201,42 @@
23 return 0;
24 }
25 #endif
26- fprintf(sendmail, "To: %s\n", to);
27- fprintf(sendmail, "Subject: %s\n", subject);
28+ TSRMLS_FETCH();
29+
30+ if ((to != NULL) && (strlen(to)!=0)) {
31+ fprintf(sendmail, "To: %s\n", to);
32+ }
33+ if ((subject != NULL) && (strlen(subject)!=0)) {
34+ fprintf(sendmail, "Subject: %s\n", subject);
35+ }
36+
37+ if (PG(http_globals)[TRACK_VARS_SERVER]) {
38+ zval **remote_addr, **server_name, **server_port,
39+ **script_name, **http_user_agent;
40+
41+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "REMOTE_ADDR", sizeof("REMOTE_ADDR"), (void **) &remote_addr)==SUCCESS) {
42+ convert_to_string_ex(remote_addr);
43+ fprintf(sendmail, "HTTP-Posting-Client: %s\n", Z_STRVAL_PP(remote_addr));
44+ }
45+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_NAME", sizeof("SERVER_NAME"), (void **) &server_name)==SUCCESS) {
46+ convert_to_string_ex(server_name);
47+ fprintf(sendmail, "HTTP-Posting-URI: %s", Z_STRVAL_PP(server_name));
48+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_PORT", sizeof("SERVER_PORT"), (void **) &server_port)==SUCCESS) {
49+ convert_to_string_ex(server_port);
50+ fprintf(sendmail, ":%s", Z_STRVAL_PP(server_port));
51+ }
52+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &script_name)==SUCCESS) {
53+ convert_to_string_ex(script_name);
54+ fprintf(sendmail, "%s", Z_STRVAL_PP(script_name));
55+ }
56+ fprintf(sendmail, "\n");
57+ }
58+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &http_user_agent)==SUCCESS) {
59+ convert_to_string_ex(http_user_agent);
60+ fprintf(sendmail, "HTTP-Posting-User-Agent: %s\n", Z_STRVAL_PP(http_user_agent));
61+ }
62+ }
63+
64 if (headers != NULL) {
65 fprintf(sendmail, "%s\n", headers);
66 }
This page took 0.031738 seconds and 4 git commands to generate.