nextcloud / mail

💌 Mail app for Nextcloud
https://apps.nextcloud.com/apps/mail
GNU Affero General Public License v3.0
845 stars 259 forks source link

Attachments not decoded when using DavMail #6878

Open leArthurDent opened 2 years ago

leArthurDent commented 2 years ago

Steps to reproduce

  1. Setup DavMail to access Exchange Mails.
  2. Receive an E-Mail with a pdf attachment.
  3. Attachment is recognized as a pdf but mail app downloads an eml file.

Expected behavior

Mail app decodes the attachment and downloads a pdf file.

Actual behavior

Mail app downloads an eml file containing the base64 encoded pdf. If I send the same message to another imap account, the attachment is downloaded correctly.

Mail app version

1.13.6

Mailserver or service

Posteo to Exchange

Operating system

Debian

PHP engine version

PHP 8.0

Web server

Apache (supported)

Database

MariaDB

Additional info

Source of the DavMail message (shortened):

` From: leArthurDent leArthurDent@imap1.de To: leArthurDent leArthurDent@exchange.de Cc: Subject: Test with attachment Date: Thu, 14 Jul 2022 08:24:13 +0000 Content-Type: multipart/mixed; boundary="=_2uho0oxLZMELMX2D26w5gRQ" Content-Transfer-Encoding: 8bit Return-Path: leArthurDent@imap1.de MIME-Version: 1.0

--=_2uho0oxLZMELMX2D26w5gRQ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit

The attachment should be below.

--=_2uho0oxLZMELMX2D26w5gRQ Content-Type: application/pdf; name="jasms.0c00467.pdf" Content-Disposition: attachment; filename="jasms.0c00467.pdf" Content-Transfer-Encoding: base64

(...)

--=_2uho0oxLZMELMX2D26w5gRQ-- `

Source of the other IMAP message (shortened):

`Subject: Test with attachment From: leArthurDent leArthurDent@imap1.de To: leArthurDent leArthurDent@imap2.de Date: Thu, 14 Jul 2022 08:35:39 +0000 Content-Type: multipart/mixed; boundary="=-QvVGVSEVGreoqqpY/CUn" MIME-Version: 1.0

--=-QvVGVSEVGreoqqpY/CUn Content-Type: text/plain Content-Transfer-Encoding: 7bit

The attachment should be below.

--=-QvVGVSEVGreoqqpY/CUn Content-Type: application/pdf; name="jasms.0c00467.pdf" Content-Disposition: attachment; filename="jasms.0c00467.pdf" Content-Transfer-Encoding: base64

(...)

--=-QvVGVSEVGreoqqpY/CUn--

`

First I thought the issue would be due to mail app not being able to read embedded messages, but these sources look almost the same.

Fun Fact: If I send the message from imap1 to exchange, I cannot download the pdf. If I forward it back from exchange to imap1, I can.

GretaD commented 2 weeks ago

Hi, can you please export your email as eml and then rename it as txt and post it here, so we can try to reproduce and see what is happening?