[GH-ISSUE #99] [Bug] Thunderbird always indicates attachment (paper clip icon) before fetching full message sent from nmail #87

Closed
opened 2026-03-03 01:19:41 +03:00 by kerem · 5 comments
Owner

Originally created by @krackout on GitHub (Mar 31, 2022).
Original GitHub issue: https://github.com/d99kris/nmail/issues/99

Originally assigned to: @d99kris on GitHub.

Sending from nmail to Thunderbird, the e-mail is shown in Thunderbird as having attachment, even when it doesn't. After clicking on it, the attachment icon disappears and doesn't appear again.

Both nmail and Thunderbird utilize IMAP connection. Through receiver's web interface instead of Thunderbird, no attachment notice is shown if there isn't any (normal behaviour). Could be Thunderbird related, I haven't tested it with other MUAs.

Originally created by @krackout on GitHub (Mar 31, 2022). Original GitHub issue: https://github.com/d99kris/nmail/issues/99 Originally assigned to: @d99kris on GitHub. Sending from nmail to Thunderbird, the e-mail is shown in Thunderbird as having attachment, even when it doesn't. After clicking on it, the attachment icon disappears and doesn't appear again. Both nmail and Thunderbird utilize IMAP connection. Through receiver's web interface instead of Thunderbird, no attachment notice is shown if there isn't any (normal behaviour). Could be Thunderbird related, I haven't tested it with other MUAs.
kerem closed this issue 2026-03-03 01:19:41 +03:00
Author
Owner

@d99kris commented on GitHub (Mar 31, 2022):

If you have one such email message, could you export it from nmail using X for example from the sent folder, alternatively I believe Thunderbird has an export message function too, but I don't know what it is called in their UI. And then send it to me (a .msg file as an attachment)?

Btw, are you using nmail to send plain text emails, or are you using the markdown compose mode, which sends both a text and a html version?

<!-- gh-comment-id:1084515094 --> @d99kris commented on GitHub (Mar 31, 2022): If you have one such email message, could you export it from `nmail` using `X` for example from the sent folder, alternatively I believe Thunderbird has an export message function too, but I don't know what it is called in their UI. And then send it to me (a `.msg` file as an attachment)? Btw, are you using nmail to send plain text emails, or are you using the markdown compose mode, which sends both a text and a html version?
Author
Owner

@krackout commented on GitHub (Mar 31, 2022):

I normally use plain text. If something is changed, it would be probably due to my fiddling with nmail's settings. Here's an e-mail:

Date: Thu, 31 Mar 2022 15:57:05 +0300
From:  <krackout@RemovedProviderToAvoidSpam.com>
To: someone@RemovedProviderToAvoidSpam.com
Message-ID: <nmail.3.62.6245a521.ded7263.1cfe@sinassos>
Subject: test4
Content-Type: multipart/mixed; boundary="6245a521_7fdcc233_1cfe"

--6245a521_7fdcc233_1cfe
Content-Type: multipart/alternative; boundary="6245a521_1befd79f_1cfe"

--6245a521_1befd79f_1cfe
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

test4
--6245a521_1befd79f_1cfe--

--6245a521_7fdcc233_1cfe--

I've also attached a screenshot from Thunderbird, the paperclip icon (attachment) seen on the left.
d99kris

<!-- gh-comment-id:1084558370 --> @krackout commented on GitHub (Mar 31, 2022): I normally use plain text. If something is changed, it would be probably due to my fiddling with nmail's settings. Here's an e-mail: ``` Date: Thu, 31 Mar 2022 15:57:05 +0300 From: <krackout@RemovedProviderToAvoidSpam.com> To: someone@RemovedProviderToAvoidSpam.com Message-ID: <nmail.3.62.6245a521.ded7263.1cfe@sinassos> Subject: test4 Content-Type: multipart/mixed; boundary="6245a521_7fdcc233_1cfe" --6245a521_7fdcc233_1cfe Content-Type: multipart/alternative; boundary="6245a521_1befd79f_1cfe" --6245a521_1befd79f_1cfe Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline test4 --6245a521_1befd79f_1cfe-- --6245a521_7fdcc233_1cfe-- ``` I've also attached a screenshot from Thunderbird, the paperclip icon (attachment) seen on the left. ![d99kris](https://user-images.githubusercontent.com/36501063/161061942-0e48a16c-a1b1-4e85-9a51-3a4d1d2c4b85.png)
Author
Owner

@d99kris commented on GitHub (Apr 3, 2022):

Thanks for sharing the additional details. I was able to reproduce this too in Thunderbird v91.7, with emails sent from latest nmail.

Comparing plain text messages sent from Thunderbird and nmail I found the message structure to be slightly different.

When I implemented the MIME encoding in nmail I went with a simple approach of using same structure for all emails, from a code comment:

  // html and text message part layout:
  // mainMultipart (content for message, subType="mixed")
  // ->htmlAndTextBodyPart (bodyPart1 for mainMultipart)
  // --->htmlAndTextMultipart (content for htmlAndTextBodyPart, subType="alternative")
  // ----->textBodyPart (bodyPart2 for the htmlAndTextMultipart)
  // ------->text (content for textBodyPart)
  // ----->htmlBodyPart (bodyPart1 for htmlAndTextMultipart)
  // ------->html (content for htmlBodyPart)
  // ->fileBodyPart1 (bodyPart2 for the mainMultipart)
  // --->FileDataHandler (content for fileBodyPart1 )

It seems Thunderbird makes a "guess" based on high(est?) level of the MIME structure, on whether a message has an attachment (before it has fetched it). There are others with this problem in Thunderbird it seems (not strictly limited to nmail messages I think) https://www.reddit.com/r/Thunderbird/comments/dkncg6/whats_up_with_mails_showing_the_attachment_symbol/

nmail on the other hand fetches and parses the entire body structure when fetching headers, so it does not suffer from this problem.

I don't remember seeing anything in RFC2045 (MIME part I) preventing using the structure that nmail uses, but I might need to re-read that old document.

Anyway.. For the benefit of working well with Thunderbird, and also for nmail to not send some chunk of unecessary bytes in emails, it might make sense to fix this in nmail. I will take a look and update here again eventually.

<!-- gh-comment-id:1086833035 --> @d99kris commented on GitHub (Apr 3, 2022): Thanks for sharing the additional details. I was able to reproduce this too in `Thunderbird` v91.7, with emails sent from latest `nmail`. Comparing plain text messages sent from `Thunderbird` and `nmail` I found the message structure to be slightly different. When I implemented the MIME encoding in `nmail` I went with a simple approach of using same structure for *all* emails, from a code comment: ``` // html and text message part layout: // mainMultipart (content for message, subType="mixed") // ->htmlAndTextBodyPart (bodyPart1 for mainMultipart) // --->htmlAndTextMultipart (content for htmlAndTextBodyPart, subType="alternative") // ----->textBodyPart (bodyPart2 for the htmlAndTextMultipart) // ------->text (content for textBodyPart) // ----->htmlBodyPart (bodyPart1 for htmlAndTextMultipart) // ------->html (content for htmlBodyPart) // ->fileBodyPart1 (bodyPart2 for the mainMultipart) // --->FileDataHandler (content for fileBodyPart1 ) ``` It seems `Thunderbird` makes a "guess" based on high(est?) level of the MIME structure, on whether a message has an attachment (before it has fetched it). There are others with this problem in `Thunderbird` it seems (not strictly limited to `nmail` messages I think) https://www.reddit.com/r/Thunderbird/comments/dkncg6/whats_up_with_mails_showing_the_attachment_symbol/ `nmail` on the other hand fetches and parses the entire body *structure* when fetching headers, so it does not suffer from this problem. I don't remember seeing anything in RFC2045 (MIME part I) preventing using the structure that `nmail` uses, but I might need to re-read that old document. Anyway.. For the benefit of working well with `Thunderbird`, and also for `nmail` to not send some chunk of unecessary bytes in emails, it might make sense to fix this in `nmail`. I will take a look and update here again eventually.
Author
Owner

@krackout commented on GitHub (Apr 3, 2022):

Interesting find. Whatever you like. Yet if it's thunderbird's bug or deviation and nmail is RFC compliant, I should have reported it to them.

<!-- gh-comment-id:1086840500 --> @krackout commented on GitHub (Apr 3, 2022): Interesting find. Whatever you like. Yet if it's `thunderbird`'s bug or deviation and `nmail` is RFC compliant, I should have reported it to them.
Author
Owner

@d99kris commented on GitHub (Apr 10, 2022):

A fix for this has been implemented in nmail now, please let me know if you still see issues with paper clip icon in Thundermail. Thanks!

<!-- gh-comment-id:1094267120 --> @d99kris commented on GitHub (Apr 10, 2022): A fix for this has been implemented in `nmail` now, please let me know if you still see issues with paper clip icon in `Thundermail`. Thanks!
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/nmail#87
No description provided.