Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.0

Request #21043 empty queued_as by pipelining
Submitted: 2016-03-22 11:12 UTC
From: degtyaryov Assigned:
Status: Open Package: Mail (version 1.3.0)
PHP Version: Irrelevant OS: Fedora 23
Roadmaps: (Not assigned)    
Subscription  


 [2016-03-22 11:12 UTC] degtyaryov (Dmitriy Degtyaryov)
Description: ------------ Hello. I logged information sent emails including queued_as. Using pipelining is not possible to get a list of queued_as for sended letters. Mail/smtp.php:306 list(,$args) = $this->_smtp->getResponse(); if (preg_match("/Ok: queued as (.*)/", $args, $queued)) { $this->queued_as = $queued[1]; } $this->queued_as already empty! Need limit pipelining commands and parse all matches: public function send($recipients, $headers, $body, Closure $callback) { ............ if ($this->isPipelingLimit) { $this->_smtp->pipelining = false } $res = $this->_smtp->data($body, $textHeaders); $this->_smtp->pipelining = true; list(,$args) = $this->_smtp->getResponse(); if (preg_match_all("/Ok: queued as (.*)/", $args, $queued)) { foreach($queued[1] as $key => $q) $this->callbacks[$key]($q); } } Example using: ............ $mail_factory->send($email, $headers, $body, function($queued_as) use ($email) { syslog(LOG_INFO, "$email queued as $queued_as"); });

Comments