30 'command' =>
'/usr/sbin/sendmail -bs',
42 parent::__construct($buf, $dispatcher);
50 if (
false !== strpos($this->
getCommand(),
' -bs')) {
71 $this->_params[
'command'] = $command;
83 return $this->_params[
'command'];
102 $failedRecipients = (array) $failedRecipients;
106 if (
false !== strpos($command,
' -t')) {
107 if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) {
108 $this->_eventDispatcher->dispatchEvent($evt,
'beforeSendPerformed');
109 if ($evt->bubbleCancelled()) {
114 if (
false === strpos($command,
' -f')) {
118 $buffer->initialize(array_merge($this->_params, array(
'command' => $command)));
120 if (
false === strpos($command,
' -i') &&
false === strpos($command,
' -oi')) {
121 $buffer->setWriteTranslations(array(
"\r\n" =>
"\n",
"\n." =>
"\n.."));
123 $buffer->setWriteTranslations(array(
"\r\n" =>
"\n"));
126 $count = count((array) $message->
getTo())
127 + count((array) $message->
getCc())
128 + count((array) $message->
getBcc())
131 $buffer->flushBuffers();
132 $buffer->setWriteTranslations(array());
133 $buffer->terminate();
137 $evt->setFailedRecipients($failedRecipients);
138 $this->_eventDispatcher->dispatchEvent($evt,
'sendPerformed');
142 }
elseif (
false !== strpos($command,
' -bs')) {
143 $count = parent::send($message, $failedRecipients);
146 'Unsupported sendmail command flags ['.$command.
']. '.
147 'Must be one of "-bs" or "-t" but can include additional flags.'