Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined property: subtype #513

Open
mastermind115 opened this issue Jul 15, 2021 · 2 comments
Open

Undefined property: subtype #513

mastermind115 opened this issue Jul 15, 2021 · 2 comments
Labels

Comments

@mastermind115
Copy link

Summary

If message has attachment with undefined subtype, any call to attachment related method triggers notice "Undefined property: stdClass::$subtype".

Current behavior

Message/AbstractPart::isAttachment (row 423) do not check if property exists.

How to reproduce: code & error stack trace

I have message in Inbox from Gmail stating that the target email account do not exist. It has 2 attachments:

  • original message (no problems).
  • status report with "Content-Type: message/delivery-status". (problem)

Expected behavior

Row 423 should be something like:
if (property_exists($part, 'subtype') and self::SUBTYPE_RFC822 === \strtoupper($part->subtype)) {

@Slamdunk
Copy link
Collaborator

Could you please post here the message/delivery-status attachment?

@mastermind115
Copy link
Author

mastermind115 commented Jul 15, 2021

Sure. I copied that from getRawMessage() output:

--00000000000078125c05b7095328\r\n
Content-Type: message/delivery-status\r\n
\r\n
Reporting-MTA: dns; googlemail.com\r\n
Received-From-MTA: dns; [email protected]\r\n
Arrival-Date: Tue, 22 Dec 2020 00:26:06 -0800 (PST)\r\n
X-Original-Message-ID: <[email protected]>\r\n
\r\n
Final-Recipient: rfc822; [email protected]\r\n
Action: failed\r\n
Status: 5.0.0\r\n
Diagnostic-Code: smtp; The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/answer/6596\r\n
Last-Attempt-Date: Tue, 22 Dec 2020 00:26:06 -0800 (PST)\r\n
\r\n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants