Changeset View
Changeset View
Standalone View
Standalone View
scripts/mail/mail_handler.php
| Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | if (preg_match('@text/(plain|html)@', $attachment->getContentType()) && | ||||
| // attachments with other content types (e.g., images) as attachments. | // attachments with other content types (e.g., images) as attachments. | ||||
| continue; | continue; | ||||
| } | } | ||||
| $file = PhabricatorFile::newFromFileData( | $file = PhabricatorFile::newFromFileData( | ||||
| $attachment->getContent(), | $attachment->getContent(), | ||||
| array( | array( | ||||
| 'name' => $attachment->getFilename(), | 'name' => $attachment->getFilename(), | ||||
| 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE, | |||||
| )); | )); | ||||
| $attachments[] = $file->getPHID(); | $attachments[] = $file->getPHID(); | ||||
| } | } | ||||
| try { | try { | ||||
| $received->setAttachments($attachments); | $received->setAttachments($attachments); | ||||
| $received->save(); | $received->save(); | ||||
| $received->processReceivedMail(); | $received->processReceivedMail(); | ||||
| } catch (Exception $e) { | } catch (Exception $e) { | ||||
| $received | $received | ||||
| ->setMessage('EXCEPTION: '.$e->getMessage()) | ->setMessage('EXCEPTION: '.$e->getMessage()) | ||||
| ->save(); | ->save(); | ||||
| throw $e; | throw $e; | ||||
| } | } | ||||