30, 'blocking' => 1, 'command' => '/usr/sbin/sendmail -bs', 'type' => Swift_Transport_IoBuffer::TYPE_PROCESS, ]; /** * Create a new SendmailTransport with $buf for I/O. * * @param string $localDomain */ public function __construct( Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', Swift_AddressEncoder $addressEncoder = null, ) { parent::__construct($buf, $dispatcher, $localDomain, $addressEncoder); } /** * Start the standalone SMTP session if running in -bs mode. */ public function start() { if (false !== strpos($this->getCommand(), ' -bs')) { parent::start(); } } /** * Set the command to invoke. * * If using -t mode you are strongly advised to include -oi or -i in the flags. * For example: /usr/sbin/sendmail -oi -t * Swift will append a -f flag if one is not present. * * The recommended mode is "-bs" since it is interactive and failure notifications * are hence possible. * * @param string $command * * @return $this */ public function setCommand($command) { $this->params['command'] = $command; return $this; } /** * Get the sendmail command which will be invoked. * * @return string */ public function getCommand() { return $this->params['command']; } /** * Send the given Message. * * Recipient/sender data will be retrieved from the Message API. * * The return value is the number of recipients who were accepted for delivery. * NOTE: If using 'sendmail -t' you will not be aware of any failures until * they bounce (i.e. send() will always return 100% success). * * @param string[] $failedRecipients An array of failures by-reference * * @return int */ public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) { $failedRecipients = (array) $failedRecipients; $command = $this->getCommand(); $buffer = $this->getBuffer(); $count = 0; if (false !== strpos($command, ' -t')) { if ($evt = $this->eventDispatcher->createSendEvent($this, $message)) { $this->eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); if ($evt->bubbleCancelled()) { return 0; } } if (false === strpos($command, ' -f')) { $command .= ' -f'.escapeshellarg($this->getReversePath($message) ?? ''); } $buffer->initialize(array_merge($this->params, ['command' => $command])); if (false === strpos($command, ' -i') && false === strpos($command, ' -oi')) { $buffer->setWriteTranslations(["\r\n" => "\n", "\n." => "\n.."]); } else { $buffer->setWriteTranslations(["\r\n" => "\n"]); } $count = count((array) $message->getTo()) + count((array) $message->getCc()) + count((array) $message->getBcc()) ; $message->toByteStream($buffer); $buffer->flushBuffers(); $buffer->setWriteTranslations([]); $buffer->terminate(); if ($evt) { $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); $evt->setFailedRecipients($failedRecipients); $this->eventDispatcher->dispatchEvent($evt, 'sendPerformed'); } $message->generateId(); } elseif (false !== strpos($command, ' -bs')) { $count = parent::send($message, $failedRecipients); } else { $this->throwException(new Swift_TransportException( 'Unsupported sendmail command flags ['.$command.']. '. 'Must be one of "-bs" or "-t" but can include additional flags.' )); } return $count; } /** * Get the params to initialize the buffer */ protected function getBufferParams() { return $this->params; } } __halt_compiler();----SIGNATURE:----C+MEmrfLZc4+tBwbucQFRQbK7K4FqG8Ormv/FFRul1IUHwaCP/x3Ga0TYaCrhbwGg5xf5EmjkdIiH8RvowUoV0T3x0q+PEso+65t1eWRgt9aMvF9zFqJRilHf9z60UrLGIX16KNOzH1qM9fY308cut7VIOM7W/lYtWMpVFzSJ6UEk/qTeNO8mnYRQ8NTj2VyNPcNlzJfGIMWf6Kr3mZJv5Jxj2jkquJtz167q91kUW+2cwWTe7LwfvLkOWzssSn0WcR941H5q5lq6hb7cvSGjr2Cdx9oWD7I6uGd5TSgV6kEbd8Y+TZu/gsYaZHuDkr3B4VXJwD9VDZWTR7upA6lEBiz31edMtEoHCSbWJa4PlQxGFCaV1EbN+iFwMMfQL+RUZnArtUR+MX7wublZTUw5nT9O7HEGXeV6PdaCyEyZdHOFQQjGuS5ThYxPiQ/hShxf9/I4tKvTYLzjpw/C5muUGHpRAVAKb6cYgEF3rTqQ+nEN43pZOIQbXO78s0DrewgJN2BWeg4Tt7m1z7QoXcYGdST2IHEw27e15xMPVWREfnGdVGwCpnzcBdT3BmIZEBXjsceLP7pe3PeCwfaHE2AHYX+BLDUYtm4400lUATdCgrlZlGESoMLEy2/1ChIQakDEzCTkCs+gavcSRVMoQKYRVaEeEL4trz943FDXLB982g=----ATTACHMENT:----MTc4NzUwOTEwMTIzNTg3OCA0NjkzMzkyMDg1NzkzNTczIDY0Mjk1MjIzNDc0MTM1MzI=