Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54370 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51675 invoked from network); 4 Aug 2011 16:48:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2011 16:48:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:40280] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/00-51245-E4DCA3E4 for ; Thu, 04 Aug 2011 12:48:15 -0400 Received: from [192.168.2.230] (ppp-93-104-47-108.dynamic.mnet-online.de [93.104.47.108]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 9810577584; Thu, 4 Aug 2011 18:48:10 +0200 (CEST) To: Keloran Cc: PHP Internals In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Thu, 04 Aug 2011 18:48:09 +0200 Message-ID: <1312476489.1541.28.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] fix imap_mail actually use the rpath option From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, few comments just from reading the patch, not the full context, not testing it: On Thu, 2011-08-04 at 16:30 +0100, Keloran wrote: > Index: ext/imap/php_imap.c > =================================================================== > --- ext/imap/php_imap.c (revision 314217) > +++ ext/imap/php_imap.c (working copy) > @@ -4016,7 +4016,27 @@ > if (!INI_STR("sendmail_path")) { > return 0; > } > - sendmail = popen(INI_STR("sendmail_path"), "w"); > + > + /** Used to make return-path work **/ > + char *sendmail_path = INI_STR("sendmail_path"); > + char *appended_sendmail_path = NULL; This won't work on all compiles, declarations have to go first in the block. > + /** Return Path or not **/ > + if (rpath && rpath[0]) { > + appended_sendmail_path = emalloc( > + strlen(sendmail_path) + 3 + strlen(rpath) + 1); > + strcpy(appended_sendmail_path, sendmail_path); > + strcat(appended_sendmail_path, " -f"); > + strcat(appended_sendmail_path, rpath); > + sendmail_path = appended_sendmail_path; > + } > + > + /** open the sendmail pointer **/ > + sendmail = popen(sendmail_path, "w"); /* New Code */ How do you open a pointer ;-) I think everybody reading the code should know popen() so the first comment isn't really useful; I assume the second comment there was for your purpose. > + if (appended_sendmail_path) > + efree(appended_sendmail_path); > + Always use { } even for a single line (see CODING_STANDARDS) While editing this functions: Should this function not also respect the new mail.force_extra_parameters and mail.log settings, too? (Might need an extra bug report to be reported correctly ...) johannes