Skip to content

.txt file attachment replaces mail content with getTextBody() #235

@Alicia-Mo

Description

@Alicia-Mo

Describe the bug
When looping through unread messages, if the email has a .txt file attached to it, the content returned by the function getTextBody() returns the content of that file instead of the content of the email. The content of the email doest exist and appears with getHTMLBody. Behavior happens even if other attachments are joined to the email.

To Reproduce
Send an email with a .txt or text/plain attachment file with text content.

Expected behavior
Retrieving the content of the email instead of the text attachment.

Screenshots
Here is the screenshot of a few lines of code and the resulting dump :
LaravelImapMail
LaravelImapMailDump

Desktop / Server

  • PHP: 7.0.27
  • Laravel : 5.5.38
  • laravel-imap : 1.4.1

Additional context
The emails is sent from Outlook 2016 and handled by an Exchange server, then redirected to a
Gandi mailbox. The Client we connect to to use laravel-imap is the Gandi mailbox (set up on port 993, ecnryption ssl, validate_cert true, protocol imap).

This is my first time opening an issue. My apologies if it is not formatted correctly, I hope I provided enough information.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions