Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37085 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13236 invoked from network); 17 Apr 2008 16:59:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2008 16:59:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=scott@macvicar.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=scott@macvicar.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain macvicar.net from 72.232.140.210 cause and error) X-PHP-List-Original-Sender: scott@macvicar.net X-Host-Fingerprint: 72.232.140.210 midden.org.uk Received: from [72.232.140.210] ([72.232.140.210:60357] helo=lovelace.midden.org.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/37-05127-DE187084 for ; Thu, 17 Apr 2008 12:59:26 -0400 Received: from office.vbulletin.com ([217.155.246.60] helo=[10.0.0.116]) by lovelace.midden.org.uk with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JmXSD-0001pw-Dn; Thu, 17 Apr 2008 17:59:21 +0100 Message-ID: <480781E0.3060805@macvicar.net> Date: Thu, 17 Apr 2008 17:59:12 +0100 User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: RQuadling@GoogleMail.com CC: PHP Developers Mailing List , jani.taskinen@iki.fi References: <10845a340804170743w3ebd165v5ffd7af28168113b@mail.gmail.com> In-Reply-To: <10845a340804170743w3ebd165v5ffd7af28168113b@mail.gmail.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Win32 mail() issue and potential fix - needs better brains than me to verify solution. From: scott@macvicar.net (Scott MacVicar) Hi Richard, The patch would fix it in this case but there is an underlying change that needs sorted. zend_ini_string()'s behaviour was changed to fix http://bugs.php.net/bug.php?id=42657 so that if the default value was NULL it would then return an empty string instead. http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini.c?r1=1.39.2.2.2.18.2.6&r2=1.39.2.2.2.18.2.7 This broke the places that were relying on INI_STR returning the NULL? Should this fix be backed out and change ini_get and ini_set to deal with this for the userland? Scott Richard Quadling wrote: > 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) { > > > >