[GH-ISSUE #452] Attachments in emails are not displayed properly or at all #438

Closed
opened 2026-02-27 11:11:46 +03:00 by kerem · 3 comments
Owner

Originally created by @tonioo on GitHub (Dec 4, 2013).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/452

Originally assigned to: @tonioo on GitHub.

Originally created by Miroslav Abrahám on 2013-09-02T22:39:01Z

When sending an email with attachment there are 4 likely scenarios that may take place. Let's assume there are 2 ways to send and receive messages - with Thunderbird and via webmail.

Thunderbird -> Thundrbird: everything seems to be fine with the attachment

Thunderbird -> webmail: the attachment is displayed corretly no matter and unicode chars or spaces in name

webmail -> Thunderbird: attachments are seen as wrapped in single quotes and when there are spaces in a file name, the file name is cut by the first space

webmail -> webmail: if a file name contains unicode chars or spaces either the attachment name is cut by the first space or it may not be visible at all

Based on a discussion on IRC later on, the first issue seemed to be with single quotes wrapping a attachment name, while double quotes it should be.
Then when this get changed to double quotes in the code, the attachments do appear in emails sent via webmail but names of attachments are renamed to {num}.

Originally created by @tonioo on GitHub (Dec 4, 2013). Original GitHub issue: https://github.com/modoboa/modoboa/issues/452 Originally assigned to: @tonioo on GitHub. **Originally created by Miroslav Abrahám on 2013-09-02T22:39:01Z** When sending an email with attachment there are 4 likely scenarios that may take place. Let's assume there are 2 ways to send and receive messages - with Thunderbird and via webmail. # Thunderbird -> Thundrbird: everything seems to be fine with the attachment # Thunderbird -> webmail: the attachment is displayed corretly no matter and unicode chars or spaces in name # webmail -> Thunderbird: attachments are seen as wrapped in single quotes and when there are spaces in a file name, the file name is cut by the first space # webmail -> webmail: if a file name contains unicode chars or spaces either the attachment name is cut by the first space or it may not be visible at all Based on a discussion on IRC later on, the first issue seemed to be with single quotes wrapping a attachment name, while double quotes it should be. Then when this get changed to double quotes in the code, the attachments do appear in emails sent via webmail but names of attachments are renamed to {num}.
kerem 2026-02-27 11:11:46 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Miroslav Abrahám on 2013-09-10T17:21:09Z

Sorry for the delay with testing, it took quite a while to go over all cases I could think of. Please find the results in the attached ODS (Open Document) file.

<!-- gh-comment-id:29816690 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Miroslav Abrahám on 2013-09-10T17:21:09Z** Sorry for the delay with testing, it took quite a while to go over all cases I could think of. Please find the results in the attached ODS (Open Document) file.
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Miroslav Abrahám on 2013-09-10T17:37:06Z

As for the size of a file not being properly reported, it appears to be an issue with gzip library. The attachment is gzipped on the server and sent to a user in a compressed form and that is why the reported size and the downloaded file size do not match.

It can be solved by commenting out the line 57 in modoboa/extensions/webmail/views.py.

resp["Content-Length"] = partdef["size"]

The downside of this is the fact that a user will not know what is the size of the file being downloaded and what is the current progress of download.

<!-- gh-comment-id:29816691 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Miroslav Abrahám on 2013-09-10T17:37:06Z** As for the size of a file not being properly reported, it appears to be an issue with gzip library. The attachment is gzipped on the server and sent to a user in a compressed form and that is why the reported size and the downloaded file size do not match. It can be solved by commenting out the _line 57_ in modoboa/extensions/webmail/views.py. <pre> resp["Content-Length"] = partdef["size"] </pre> The downside of this is the fact that a user will not know what is the size of the file being downloaded and what is the current progress of download.
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Miroslav Abrahám on 2013-09-26T13:50:50Z

Everything seems to be working now, feel free to see the test file attached for results.

<!-- gh-comment-id:29816692 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Miroslav Abrahám on 2013-09-26T13:50:50Z** Everything seems to be working now, feel free to see the test file attached for results.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#438
No description provided.