Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37069 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33249 invoked from network); 17 Apr 2008 14:43:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2008 14:43:53 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.162.182 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 209.85.162.182 el-out-1112.google.com Received: from [209.85.162.182] ([209.85.162.182:29797] helo=el-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/D5-05127-32267084 for ; Thu, 17 Apr 2008 10:43:48 -0400 Received: by el-out-1112.google.com with SMTP id m34so46913ele.13 for ; Thu, 17 Apr 2008 07:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:mime-version:content-type; bh=9WeKhwpnd7dCq5P4H6WmNVOfOo7Kt9C6ocSSnU3LIJ8=; b=jCHl675sqGxSnuiZH+Um/hAtT3EN3cOt3Oz12VfG+XvBByDHN5foHkpUOP+PLdqPedjL8PR9TOsYeP67IT18N09S0gGFpCY4AFdO40OGlHrM74warlhnMak+8p0VtKs6yActcf41KaqInxHObFadun+HvlbjNwP6SyQfEkHUQv8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:mime-version:content-type; b=F2SS4p+0sSD+ftD9ciHWyhpzzT+KuJDjshMYxf9jrcGhlMo+f+3KzVQ4x9Nia1X1uCKbsq2NYPjbOlmop8UrNV6lFmTy+W7vNLqdCa7k+1ejD/pGHSCkXs1YBatRNkzOIu/bR73A05kJiFKGEpIowdPn94mFUz/j26bqtLGmM5Y= Received: by 10.115.32.1 with SMTP id k1mr1521748waj.107.1208443423546; Thu, 17 Apr 2008 07:43:43 -0700 (PDT) Received: by 10.114.209.15 with HTTP; Thu, 17 Apr 2008 07:43:43 -0700 (PDT) Message-ID: <10845a340804170743w3ebd165v5ffd7af28168113b@mail.gmail.com> Date: Thu, 17 Apr 2008 15:43:43 +0100 Reply-To: RQuadling@GoogleMail.com To: "PHP Developers Mailing List" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_967_27457.1208443423542" Subject: Win32 mail() issue and potential fix - needs better brains than me to verify solution. From: rquadling@googlemail.com ("Richard Quadling") ------=_Part_967_27457.1208443423542 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi. I have finally managed to get php to compile for windows (yippee for me). So I can now try and get mail() working again. The issue is that in ext/standard/mail.c (/* $Id: mail.c,v 1.87.2.1.2.7.2.3 2007/12/31 07:17:15 sebastian Exp $ */), line 197, the test of ... if (!sendmail_path) always evaluates to false when there is no sendmail_path which would be the case on windows. The next line differentiates between processing for windows/netware and everything else. If the test is if(0 == strlen(sendmail_path)) then that would work. The INI_STR call in Line 194 always returns a string if the directive is known (doesn't need to be set, just has to exist as a directive). So, I've attached a patch which I have compiled and tested on Windows. This is in relation to bug http://bugs.php.net/bug.php?id=43348 Index: mail.c =================================================================== RCS file: /repository/php-src/ext/standard/mail.c,v retrieving revision 1.87.2.1.2.7.2.3 diff -u -u -r1.87.2.1.2.7.2.3 mail.c --- mail.c 31 Dec 2007 07:17:15 -0000 1.87.2.1.2.7.2.3 +++ mail.c 17 Apr 2008 14:40:33 -0000 @@ -194,7 +194,7 @@ char *sendmail_path = INI_STR("sendmail_path"); char *sendmail_cmd = NULL; - if (!sendmail_path) { + if (0 == strlen(sendmail_path)) { #if (defined PHP_WIN32 || defined NETWARE) /* handle old style win smtp sending */ if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject, to, message, NULL, NULL, NULL TSRMLS_CC) == FAILURE) { -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!" ------=_Part_967_27457.1208443423542--