Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60532 invoked from network); 4 Aug 2011 16:56:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2011 16:56:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=ava3ar@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ava3ar@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) X-PHP-List-Original-Sender: ava3ar@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:58457] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/02-51245-65FCA3E4 for ; Thu, 04 Aug 2011 12:56:55 -0400 Received: by vwl1 with SMTP id 1so1373538vwl.29 for ; Thu, 04 Aug 2011 09:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=GCom0wwZBPswlQNhy0T3Hk0jMgYTVjdMxRTtOBoP9I4=; b=bffqv1ZWoaZMSZiHvC7PUmXI7rsfbB6xnxdmbKURUUlpO7WwKQSt0W6ba0oXeH/UeU DpuKvV9sCAvStJVtACfprq/WIs5hKrZNdSoliZqrQdZIgMeIymASe5BKH/40OWcrmFc4 zLw1TikONG0A6cEyaBuTlcrB1swlQZYHtEfOE= MIME-Version: 1.0 Received: by 10.52.21.201 with SMTP id x9mr709324vde.363.1312477011709; Thu, 04 Aug 2011 09:56:51 -0700 (PDT) Received: by 10.220.164.16 with HTTP; Thu, 4 Aug 2011 09:56:51 -0700 (PDT) In-Reply-To: <1312476489.1541.28.camel@guybrush> References: <1312476489.1541.28.camel@guybrush> Date: Thu, 4 Aug 2011 17:56:51 +0100 Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= Cc: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] fix imap_mail actually use the rpath option From: ava3ar@gmail.com (Keloran) Yeah it does need cleaning up, didn't know about the new mail options, main reason I did it was because the function has had the option since 2004, but it's never actually used it On Thursday, August 4, 2011, Johannes Schl=FCter w= rote: > 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 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- ext/imap/php_imap.c (revision 314217) >> +++ ext/imap/php_imap.c (working copy) >> @@ -4016,7 +4016,27 @@ >> =A0 =A0 =A0 =A0 if (!INI_STR("sendmail_path")) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return 0; >> =A0 =A0 =A0 =A0 } >> - =A0 =A0 =A0 sendmail =3D popen(INI_STR("sendmail_path"), "w"); >> + >> + =A0 =A0 =A0 /** Used to make return-path work **/ >> + =A0 =A0 =A0 =A0char *sendmail_path =3D INI_STR("sendmail_path"); >> + =A0 =A0 =A0 =A0char *appended_sendmail_path =3D NULL; > > This won't work on all compiles, declarations have to go first in the > block. > >> + =A0 =A0 =A0 =A0/** Return Path or not **/ >> + =A0 =A0 =A0 =A0if (rpath && rpath[0]) { >> + =A0 =A0 =A0 =A0 =A0 =A0appended_sendmail_path =3D emalloc( >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0strlen(sendmail_path) + 3 + strlen(rpat= h) + 1); >> + =A0 =A0 =A0 =A0 =A0 =A0strcpy(appended_sendmail_path, sendmail_path); >> + =A0 =A0 =A0 =A0 =A0 =A0strcat(appended_sendmail_path, " -f"); >> + =A0 =A0 =A0 =A0 =A0 =A0strcat(appended_sendmail_path, rpath); >> + =A0 =A0 =A0 =A0 =A0 =A0sendmail_path =3D appended_sendmail_path; >> + =A0 =A0 =A0 =A0} >> + >> + =A0 =A0 =A0 =A0/** open the sendmail pointer **/ >> + =A0 =A0 =A0 =A0sendmail =3D 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. > >> + =A0 =A0 =A0 if (appended_sendmail_path) >> + =A0 =A0 =A0 =A0 =A0 =A0efree(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 > >