Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73411 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94400 invoked from network); 25 Mar 2014 04:13:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2014 04:13:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.213.50 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.213.50 mail-yh0-f50.google.com Received: from [209.85.213.50] ([209.85.213.50:63554] helo=mail-yh0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 73/00-28634-77201335 for ; Mon, 24 Mar 2014 23:13:45 -0500 Received: by mail-yh0-f50.google.com with SMTP id c41so6154279yho.23 for ; Mon, 24 Mar 2014 21:13:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=GjlXn22UKNNBmn84odVOowPK9x5d+IByf2w2sh2Q6ug=; b=KeRvVVKMQj43d+G78M7BKM6z7gRhAQQGPW7x/q4+EXkVdmVh0q0FZVZ31NCZsKb4Tk BqQ7ZkZEgZLygcnmz4wY6uGMh+dMPVCIZAQRGt00ZPFhVCR9DZViItbWnHlNXw5bItc8 1gA5L5o4W/rJ86NieiJMMYuqInaD3epDq4X5ZbPQq2H8xOUydJhaK8nioEQi2+kyK3Dt RMqxLnbZRGDXQLX/NS5a57GEVGIz9Btw2X8GGkT8J5UD9u0aIp8Qbd7WdDJdUbMRpkCp jDRVoP9x7oeyjy5W9R3IxspBYNqnFOkw88GxhUkVLqG+25qcefFE3uPswC+6kIG4wuy3 lS+Q== X-Gm-Message-State: ALoCoQnF0hpD4JWYZeCwuSLTYzbTqdzKmrY+jbQfRbfdcBN/VP4vkCgyFmPSr9QH5SQ1PSVzNAur X-Received: by 10.236.94.197 with SMTP id n45mr69514392yhf.46.1395720821145; Mon, 24 Mar 2014 21:13:41 -0700 (PDT) Received: from [192.168.200.30] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPSA id 46sm26765648yhg.36.2014.03.24.21.13.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Mar 2014 21:13:39 -0700 (PDT) Message-ID: <53310270.1030607@lerdorf.com> Date: Mon, 24 Mar 2014 21:13:36 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Stas Malyshev , Gary Mort , "internals@lists.php.net" References: <5330E319.5060302@gmail.com> <5330F2B2.1030201@sugarcrm.com> In-Reply-To: <5330F2B2.1030201@sugarcrm.com> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Iln6OQ9RSkJVSgpGTbiFAMScXARnMekUA" Subject: Re: [PHP-DEV] Proposal: Mail Handling, feedback requested From: rasmus@lerdorf.com (Rasmus Lerdorf) --Iln6OQ9RSkJVSgpGTbiFAMScXARnMekUA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 3/24/14, 8:06 PM, Stas Malyshev wrote: > Gary Mort wrote: >> My goal is that the creation and sending of basic e-mail should be a=20 >> simple operation. It should be possible for a developer to simply cal= l=20 >> the mail() function and not be concerned about possible e-mail handlin= g=20 >> configurations. >=20 > I'm not sure - so how you actually configure the email server in your > model and what advantage it gives over mail()? Is it just the framework= > for mail() to call? Then it probably should just have one send() method= > and not contain any business logic - that should be either in mail() or= > in specific handlers. I actually like the idea of such class for mail()= > alike to what we did for sessions, but the API should be refined so tha= t > it matches what people do with emails, and error reporting capabilities= > should be added (e.g. for some applications what email server answered > is actually important). Right, the real complication is actually at the PHP configuration level. At the userspace level it is hard to know how a particular PHP installation has been configured in terms of what happens when you call mail(). That is partially by design. Not the information hiding part, but the separation between the configuration and the mail function itself and the relative dumbness of that mail() function. The way I intended, and the way I hoped, people would configure their PHP and underlying mail setups when I initially wrote the mail() function (nearly 20 years ago now) was for sendmail (or equivalent) to run in queue-only mode with a periodic queue run. This has multiple advantages: 1. Sending an email is virtually instantaneous as far as PHP is concerned since the email is just written to the local queue (which could be on the same or a different host on the local network) 2. A high percentage of people have their emails hosted by a small number of large companies. gmail, hotmail, yahoo mail, etc. So by using a queue and batch process mode your mail transfer agent will make a single connection to gmail and send every message destined for gmail in a single connection even if those messages originated from many different scripts on your end. 3. Mail transfer agents are incredibly complex. Trying to do any of this in PHP to any acceptable level of completeness would have been way too much of a timesink. I know some frameworks have tried to tackle #3 there because they can't rely on a sane local mail configuration. I read your suggestions through twice and honestly I can't quite figure out what you are trying to solve. Is it #3? It didn't quite seem like it. You still want to let the system admin define the actual underlying mail stream mechanism, I think, since #1 and #2 are essential for performance and efficiency. So it is just a really complicated version of the mail() function, right? -Rasmus --Iln6OQ9RSkJVSgpGTbiFAMScXARnMekUA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org iEYEARECAAYFAlMxAnEACgkQlxayKTuqOuC79QCcDXIJeVQKHnF697AnCQlUl5Re ESEAn0OSngUa5cipioNcyhua2ccLFrxc =k4qJ -----END PGP SIGNATURE----- --Iln6OQ9RSkJVSgpGTbiFAMScXARnMekUA--