Permalink
Browse files

- convert to package.xml 2.0

- allow turning on smtp pipelining if both Net_SMTP and the smtp server support it (Christian Schmidt)


git-svn-id: http://svn.php.net/repository/pear/packages/Mail/trunk@239264 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 7a01670 commit ad63717c29d98bb2f065d185f84b81a359959fe7 Chuck Hagenbuch committed Jul 8, 2007
Showing with 358 additions and 200 deletions.
  1. +16 −2 Mail/smtp.php
  2. +342 −198 package.xml
View
@@ -129,6 +129,14 @@ class Mail_smtp extends Mail {
*/
var $persist = false;
+ /**
+ * Use SMTP command pipelining (specified in RFC 2920) if the SMTP server
+ * supports it. This speeds up delivery over high-latency connections. By
+ * default, use the default value supplied by Net_SMTP.
+ * @var bool
+ */
+ var $pipelining;
+
/**
* Constructor.
*
@@ -144,6 +152,7 @@ class Mail_smtp extends Mail {
* verp Whether to use VERP or not. Defaults to false.
* debug Activate SMTP debug mode? Defaults to false.
* persist Should the SMTP connection persist?
+ * pipelining Use SMTP command pipelining
*
* If a parameter is present in the $params array, it replaces the
* default.
@@ -162,8 +171,9 @@ function Mail_smtp($params)
if (isset($params['localhost'])) $this->localhost = $params['localhost'];
if (isset($params['timeout'])) $this->timeout = $params['timeout'];
if (isset($params['verp'])) $this->verp = $params['verp'];
- if (isset($params['debug'])) $this->debug = (boolean)$params['debug'];
- if (isset($params['persist'])) $this->persist = (boolean)$params['persist'];
+ if (isset($params['debug'])) $this->debug = (bool)$params['debug'];
+ if (isset($params['persist'])) $this->persist = (bool)$params['persist'];
+ if (isset($params['pipelining'])) $this->pipelining = (bool)$params['pipelining'];
register_shutdown_function(array(&$this, '_Mail_smtp'));
}
@@ -216,6 +226,10 @@ function send($recipients, $headers, $body)
PEAR_MAIL_SMTP_ERROR_CREATE);
}
+ if (isset($this->pipelining)) {
+ $this->_smtp->pipelining = $this->pipelining;
+ }
+
/* Configure the SMTP connection. */
if ($this->debug) {
$this->_smtp->setDebug(true);
Oops, something went wrong.

0 comments on commit ad63717

Please sign in to comment.