afterlogic / webmail-lite-8

Open-source webmail script for existing IMAP server
https://afterlogic.org/webmail-lite-8
GNU Affero General Public License v3.0
335 stars 71 forks source link

CSV and TXT attachments shown inside body #51

Closed zdenak11 closed 4 years ago

zdenak11 commented 4 years ago

When reading emails in webmail-lite with attachments in text/plain format or application/octet-stream CSV files, the content of attachments is printed inside text of message body, but there is no button to download those attachments.

For example there are headers from .eml file with problematic attachments.

------NextPart_20191104115111
Content-Type: application/octet-stream; name="INV_12173257_1204049456.CSV"
Content-Disposition: attachment; filename="INV_12173257_1204049456.CSV"
Content-Transfer-Encoding: 8bit
--=_E9FEF66472BF0FF180DC00505697CC3A
Content-Disposition: attachment;
 filename="DESADV_0104521014_0260890706.txt"
Content-Type: text/plain;
 name="DESADV_0104521014_0260890706.txt"
Content-Transfer-Encoding: base64
Content-Description: DESADV_0104521014_0260890706
afterlogic-support commented 4 years ago

To check that, we need a message saved as EML file.

zdenak11 commented 4 years ago

There is an example email with screenshot, how it is shown in webmail.

email.zip

afterlogic-support commented 4 years ago

What's the version of WebMail you run? I've just checked this with the latest 8.3.11 and it's shown as expected there.

mail-preview

zdenak11 commented 4 years ago

I have version 8.3.9-build-a3. I tried upgrading to current version and the problem is still there.

afterlogic-support commented 4 years ago

Sounds like it's something specific to IMAP server you use. If you can provide a test account via HelpDesk, we could take a look.

zdenak11 commented 4 years ago

I send test account credentials through helpdesk and send testing email to it.

afterlogic-support commented 4 years ago

Thank you. The issue is with IMAP server indeed. Our WebMail uses IMAP BODYSTRUCTURE request to analyze email messages without downloading them in full, and we have to rely on responses returned by IMAP server. On our server, BODYSTRUCTURE response looks like this:

[08:47:34.31][d54259f7] IMAP[DATA]: < * 1 FETCH (UID 1 RFC822.SIZE 3355 INTERNALDATE "06-Nov-2019 01:47:07 -0700" FLAGS (\Seen) BODYSTRUCTURE (("text" "plain" ("charset" "iso-8859-2" "format" "flowed") NIL NIL "7bit" 45 2 NIL NIL NIL NIL)("text" "plain" ("charset" "UTF-8" "name" "test.txt") NIL NIL "base64" 56 0 NIL ("attachment" ("filename" "test.txt")) NIL NIL) "mixed" ("boundary" "------------2D146D0917AC6C2C3EE8332B") NIL ("cs") NIL) BODY[HEADER] {2833}\r\n

As you can see, the response contains information on test.txt attachment. But in BODYSTRUCTURE response returned by your server, there is no such information:

[08:41:18.78][bc1fc355] IMAP[DATA]: < * 1 FETCH (UID 5 RFC822.SIZE 3321 INTERNALDATE "05-Nov-2019 15:28:43 +0000" FLAGS (\Seen) BODYSTRUCTURE (("text" "plain" ("charset" "iso-8859-2") NIL NIL "7bit" 45 1 NIL NIL NIL)("text" "plain" ("charset" "UTF-8" "name" "=?utf-8?B?dGVzdC50eHQ=?=") NIL NIL "base64" 56 1 NIL NIL NIL) "mixed" NIL NIL NIL) BODY[HEADER] {2799}\r\n

We recommend taking this to support staff or the developers of mail server software you use.