public function __construct(parent $parent, $width = null)
 {
     parent::__construct($parent);
     if (isset($width)) {
         $this->width = $width;
     }
 }
Exemplo n.º 2
0
 /**
  * Initializes the parser, and the mail envelope if already known.
  */
 public function __construct(parent $parent, $sender = null, $recipient = null, $ip = null, $helo = null, $hostname = null)
 {
     $this->envelope = (object) array('sender' => $sender, 'recipient' => $recipient, 'clientIp' => $ip, 'clientHelo' => $helo, 'clientHostname' => $hostname);
     $this->mimePart = (object) $this->mimePart;
     $this->nextType = (object) $this->nextType;
     parent::__construct($parent);
 }
 public function __construct(parent $parent, array $headers)
 {
     if ($headers) {
         parent::__construct($parent);
         foreach ($headers as $h) {
             $this->caughtHeaders[$h] = false;
         }
     }
 }
Exemplo n.º 4
0
 public function __construct(parent $parent)
 {
     parent::__construct($parent);
     if (__CLASS__ !== get_class($this)) {
         if (isset($this->dependencies['Mail\\Auth']->authenticationResults) && $this->dependencies['Mail\\Auth'] instanceof self) {
             $this->authenticationResults =& $this->dependencies['Mail\\Auth']->authenticationResults[$this->authClass];
         } else {
             user_error(__CLASS__ . ' dependency is not loaded');
         }
     }
 }
 public function __construct(parent $parent)
 {
     parent::__construct($parent);
     $this->register(array('catchBounceExclusivity' => T_BOUNCE_EXCLUSIVITY));
     if (__CLASS__ !== ($c = get_class($this))) {
         if (isset($this->dependencies['Mail\\Bounce']->bounceReports) && $this->dependencies['Mail\\Bounce'] instanceof self) {
             $this->bounceReports =& $this->dependencies['Mail\\Bounce']->bounceReports[$this->bounceClass][$c];
         } else {
             user_error(__CLASS__ . ' dependency is not loaded');
         }
     }
 }
#!/usr/bin/php -q
<?php 
require __DIR__ . '/parse-mail-config.php';
use Patchwork\Stream\Parser;
use Patchwork\Stream\Parser\Mail\Bounce;
use Patchwork\Stream\Parser\Mail\Auth;
$parser = new Parser();
$mail = new Parser\Mail($parser);
new Parser\Mail\EnvelopeHeaders($parser);
new Parser\Mail\Pra($parser);
$auth = new Auth($parser);
new Auth\Client($parser, $local_whitelist);
new Auth\Greylist($parser);
new Auth\MessageId($parser, isset($db) ? array($db, 'messageIdExists') : false);
$boun = new Bounce($parser);
new Bounce\Rfc3464($parser);
new Bounce\Autoreply($parser);
new Bounce\Qmail($parser);
new Bounce\Exim($parser);
new Bounce\ReceivedFor($parser);
//new Parser\Dumper($parser);
$parser->parseStream(STDIN);
if ($e = $parser->getErrors()) {
    print_r($e);
} else {
    $mail = $mail->getEnvelope();
    $auth = $auth->getAuthenticationResults();
    $boun = $boun->getBounceReports();
    $auth['sent-time'] = isset($db) ? $db->getAuthSentTime($mail->recipient, $boun) : null;
    print_r($mail);
    print_r($auth);
 public function __construct(parent $parent, $stream)
 {
     parent::__construct($parent);
     $this->stream = $stream;
 }
#!/usr/bin/php -q
<?php 
require __DIR__ . '/parse-mail-config.php';
use Patchwork\Stream\Parser;
use Patchwork\Stream\Parser\Mail\Bounce;
use Patchwork\Stream\Parser\Mail\Auth;
foreach ($_SERVER['argv'] as $file) {
    if (!is_dir($file) && false !== ($h = fopen($file, 'r'))) {
        $parser = new Parser();
        $mail = new Parser\Mail($parser);
        new Parser\Mail\EnvelopeHeaders($parser);
        new Parser\Mail\Pra($parser);
        $auth = new Auth($parser);
        new Auth\Client($parser, $local_whitelist);
        new Auth\Greylist($parser);
        $omId = new Auth\MessageId($parser, isset($db) ? array($db, 'messageIdExists') : false);
        $boun = new Bounce($parser);
        new Bounce\Rfc3464($parser);
        new Bounce\Autoreply($parser);
        new Bounce\Qmail($parser);
        new Bounce\Exim($parser);
        new Bounce\ReceivedFor($parser);
        file_put_contents('php://stderr', $file . "\n");
        $parser->parseStream($h);
        fclose($h);
        if ($e = $parser->getErrors()) {
            file_put_contents('php://stderr', print_r($e, true));
        } else {
            $mail = $mail->getEnvelope();
            $auth = $auth->getAuthenticationResults();
            $omId = $omId->getMessageId();