Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91459 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28373 invoked from network); 29 Feb 2016 13:58:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Feb 2016 13:58:13 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:48599] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/F1-10408-27E44D65 for ; Mon, 29 Feb 2016 08:58:11 -0500 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 00002421A9; Mon, 29 Feb 2016 14:58:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.34] (ppp-93-104-12-10.dynamic.mnet-online.de [93.104.12.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 06A91421A4; Mon, 29 Feb 2016 14:58:16 +0100 (CET) Message-ID: <1456754284.20636.19.camel@kuechenschabe> To: Dolf Schimmel Cc: "internals@lists.php.net" Date: Mon, 29 Feb 2016 14:58:04 +0100 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-f8/ODXZVmVH1FXeoirxl" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Subject: Re: [PHP-DEV] RFC Proposal: Pluggable Mail Transports From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) --=-f8/ODXZVmVH1FXeoirxl Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 2016-02-28 at 17:55 +0000, Dolf Schimmel wrote: > Howdy, >=20 > I'm planning to create an RFC on this shortly, but would like to gauge > the initial response first. >=20 > Currently whenever an email is sent through the mail() function it is > sent by an invocation of a sendmail-compatible executable. However, > there are scenario's in which an alternative transport than through a > sendmail executable may be desired. For example when PHP has been > locked down, preventing it from starting any executables. It would be > nice if it would be possible to allow such an alternative e.g. through > a PHP Extension. Of course there are many frameworks out there that > setup an smtp connection themselves, but in a shared hosting > environment it's unfeasible to tell users they can't use the mail() > function. For one: Why can't they use the mail function? A hoster can easily provide a sendmail-compatible program doing whatever is needed in the environment. The purpose of the function is to get rid of mail reliably and quickly in order to have it queued somewhere. PHP shouldn't be the MTA. That's a tough task (i.e. what to do when the SMTP server is down or slow? - PHP shouldn't have to wait) So I'd like to learn where mail() can't be used (aside from a dev desktop where this might need "too much" system configuration) And as a side note: If you really have a special case where providing a sendmail tool is no option you could easily create an extension replacing mail() with a custom function (mbstring functions, runkit and other extensions show how this can be done) > The patch I'm proposing can be found here: > https://github.com/php/php-src/pull/1778/files I haven't fully reviewed this. But you're not handing extension unloading. In some SAPIs we have dl() available and serve multiple requests. Thus in one request a mail module could be loaded by dl() on shutdown the extension will be unloaded, but the pointer will still exist in the handler table. johannes --=-f8/ODXZVmVH1FXeoirxl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABAgAGBQJW1E5sAAoJEH3sTmn8nIPXsNwH/1D1b/KvVyvcPF4YcQPebkj9 wqxuTZkyr3H44xr9VEYMlJUr/PmO8eEHYk2rHj1OWDlP0VGkQ/ErNLujz1EFj0wL WdKxE9IwroklRaY9dX1eHhITOFTdRBivb/8ijoYlfvcBvqmObHiduBQR4cZaDhTs hR1QSdmJmiWR/lZvnbWdVjmM0HkapHfltHwMyZ/lf/O6p2e/vbfq9m3Ey88r4riS pgkCr4qYtxWr6sgMvDKjmuIA91KZRCaNuuW1/w+sKZNeCKjMnRI4/a3fZD2dnNZH LG3TL8S6gfVN+Q7alm8+CyLBl1n1ISXyVhZUx44eNfn1jGXhXuGS70hRMKHCGwI= =RRQl -----END PGP SIGNATURE----- --=-f8/ODXZVmVH1FXeoirxl--