Re: Improving mail() 5th parameter handling

From: Date: Tue, 17 Jan 2017 16:26:03 +0000
Subject: Re: Improving mail() 5th parameter handling
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-97817@lists.php.net to get a copy of this message
Hi! > I'm planning to use extra_parameters array like > > $opts = [ > '-f' => 'some@example.com > <mailto:some@example.com>', // Envelope sender > '-4' => null, // Force IPv4 > '-au' => 'user@example.com > <mailto:user@example.com>', // SMTP auth user > '-ap' => 'secret', // SMTP auth password > '-am' => 'CRAM-MD5', // SMTP auth method > ]; I don't think it is a good idea. Starting options with "-" is indeed a tradition, but only a tradition, and nothing prevents a tool from having different way of accepting options, including long format (--option) or Windows format (/option) or any other way. Hard-coupling it with specific sendmail options does not seem a good idea to me. It's better to tread each option as a full string than trying to parse it and introduce hard dependencies on specific binary's internals. > I cannot reseach all kinds of sendmail binaries. If there are exotic > sendmail binaries, > I would like to know the reference for them. Thank you. I don't think it is a good idea to specialize for specific binaries. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#97817) next »