--- php-5.4.6/ext/standard/mail.c.o 2012-09-26 17:30:48.994617098 +0200 +++ php-5.4.6/ext/standard/mail.c 2012-09-26 17:42:45.583650915 +0200 @@ -280,6 +280,17 @@ } efree(f); } + { // Add X-PHP-URI header. + const char* tmp = php_apache_getenv("SCRIPT_URI"); + char *hdr2; + if (hdr) + spprintf(&hdr2, 0, "X-PHP-URI: %s\n%s", tmp, hdr); + else + spprintf(&hdr2, 0, "X-PHP-URI: %s\n", tmp); + if (hdr != headers) + efree(hdr); + hdr = hdr2; + } if (!sendmail_path) { #if (defined PHP_WIN32 || defined NETWARE)