Ver código fonte

Fixed missing To: header bug

Will Browning 5 anos atrás
pai
commit
ac65f359c3
2 arquivos alterados com 5 adições e 1 exclusões
  1. 1 1
      app/Console/Commands/ReceiveEmail.php
  2. 4 0
      app/EmailData.php

+ 1 - 1
app/Console/Commands/ReceiveEmail.php

@@ -74,7 +74,7 @@ class ReceiveEmail extends Command
             $this->size = $this->option('size') / ($recipientCount ? $recipientCount : 1);
 
             foreach ($recipients as $key => $recipient) {
-                $displayTo = $this->parser->getAddresses('to')[$key]['display'];
+                $displayTo = $this->parser->getAddresses('to')[$key]['display'] ?? null;
 
                 $parentDomain = collect(config('anonaddy.all_domains'))
                     ->filter(function ($name) use ($recipient) {

+ 4 - 0
app/EmailData.php

@@ -16,6 +16,10 @@ class EmailData
         $this->attachments = [];
 
         foreach ($parser->getAttachments() as $attachment) {
+            if ($attachment->getContentType() === 'text/plain') {
+                $this->text = base64_encode($parser->getMessageBody('text'));
+            }
+
             $this->attachments[] = [
               'stream' => base64_encode(stream_get_contents($attachment->getStream())),
               'file_name' => $attachment->getFileName(),