Handle delete/detach attachment feature with crypto-signed mails
Categories
(MailNews Core :: Attachments, defect)
Tracking
(Not tracked)
People
(Reporter: BenB, Unassigned)
References
Details
Attachments
(1 file)
86.47 KB,
image/png
|
Details |
Comment 1•20 years ago
|
||
Reporter | ||
Comment 2•20 years ago
|
||
Comment 3•20 years ago
|
||
Reporter | ||
Comment 4•20 years ago
|
||
Comment 5•20 years ago
|
||
Comment 6•20 years ago
|
||
Reporter | ||
Comment 8•20 years ago
|
||
Reporter | ||
Comment 9•20 years ago
|
||
Comment 10•20 years ago
|
||
Comment 11•20 years ago
|
||
Updated•20 years ago
|
Comment 12•20 years ago
|
||
Comment 13•19 years ago
|
||
Comment 14•19 years ago
|
||
Comment 15•18 years ago
|
||
Comment 16•18 years ago
|
||
Updated•17 years ago
|
Comment 18•17 years ago
|
||
Assignee | ||
Updated•17 years ago
|
Comment 19•16 years ago
|
||
Comment 20•16 years ago
|
||
Comment 21•16 years ago
|
||
Comment 22•16 years ago
|
||
Comment 23•16 years ago
|
||
Updated•13 years ago
|
Comment 25•13 years ago
|
||
Updated•13 years ago
|
Comment 26•12 years ago
|
||
Comment 27•10 years ago
|
||
Comment 28•10 years ago
|
||
Comment 29•10 years ago
|
||
Comment 30•9 years ago
|
||
Comment 31•9 years ago
|
||
Comment 32•9 years ago
|
||
Comment 33•9 years ago
|
||
Comment 34•8 years ago
|
||
Comment 35•8 years ago
|
||
Comment 36•8 years ago
|
||
Comment 37•6 years ago
|
||
Hi everybody,
more or less daily I send out emails with attachments, and I like the idea of having my emails signed. But the attachments are blowing up my email folder size on hard disk, so I have to stop signing them. And I want to read them in 25 years still without any special tools installed.
Please make it possible to remove attachments from sent and signed emails. All I need is, that the recipient receives my emails signed - I don't need them signed on my own system (a flag showing "Sent signed" would be sufficient). The same applies to encryption.
I'm using Seamonkey myself, but hope to get this fix one day from Thunderbird into Seamonkey (or I will switch to Thunderbird for the case there will not come any update to Seamonkey anymore).
Friendly greetings,
Torsten
Comment 39•5 years ago
•
|
||
I don't think bug 1282701 is a duplicate of this. Original post talks about sign icon being broken after an attachment is deleted. Referenced bug talks about inability to easily remove attachments in signed emails.
Comment 40•4 years ago
|
||
I tried to "clean" some (actually many) of my e-mails (I wanted to keep the text while reducing the file size by deleting the attachments) and this still seems to be a big problem after 16 years (!)... as I use TB in a corporate environment, many of the e-mails are signed and thus they become blank when deleting the attachment (the text ist still there when exporting to .eml and using some text editor to read them, but alas, that's not the way to read an archived email :)...
Is there a possibility that somebody fixes this and somehow makes it possible that the text is still readable and - as suggested before - a message appears with something like "The digital signature has been removed from this message because the attachment
was removed, thus altering the e-mail."?
Comment 41•4 years ago
|
||
Dear all,
The impossibility to remove attachments of signed emails is actually very annoying. The size of my mail box is limited and I need to delete some attachments, which I cannot currently. This problem seems to be already 16 years (!) old. Is there anyway to make this topic visible again for the developers?
Thanks in advance for this and btw. thank you very much for providing us with Thunderbird. I'm using it for years now and expect this issue, I have always been very satisfied with it.
Comment 42•4 years ago
|
||
(In reply to Jean from comment #41)
The size of my mail box is limited and I need to delete some attachments, which I cannot currently.
If doing some one-off housekeeping is urgent for you, a fairly simple workaround would be to use a different e-mail client to delete the offending attachments. You can install it just for this purpose and then uninstall it once you're done. IIRC KMail is able to delete attachments from signed e-mails; probably there are other clients which also have this functionality.
Comment 43•4 years ago
|
||
(In reply to Tristan Miller from comment #42)
If doing some one-off housekeeping is urgent for you, a fairly simple workaround would be to use a different e-mail client to delete the offending attachments. You can install it just for this purpose and then uninstall it once you're done. IIRC KMail is able to delete attachments from signed e-mails; probably there are other clients which also have this functionality.
Thanks for the tip! When having a lot of folders, however, it takes quite a bit of time to go through them all. Deleting the attachments as they come would be for sure a more practical solution for the future.
Comment 44•4 years ago
|
||
I am another annoyed TB user, which need to ged rid of big attachment of signed e-mails. And as many others I do not mind that after removing attachment the mail is not correctly signed anymore - I do not need emails in my mailbox to be signed. I just need to be able read old emails without dealing with giant mailbox because of attachment I know I do not need to keep.
And it is bad that I have to use a hack like changing the email source to be able to remove an attachment. That is not user friendly approach at all. And (as by many other softwares) we all can see what is the result: user friendly advice "use another software". It is a good way how to slowly loose users. Which is sad, while I like Thunderbird and wish him long life with happy users...
Updated•2 years ago
|
Comment 45•2 years ago
|
||
And still we cannot get rid of attachment when someone is signing its emails, even with non valid signatures. Because all our messages will likely be under some Court investigation, and we should not decide on our own what to keep and what to delete (but we can delete the whole message, so...)
Anyway, who would have thought ~20 years ago that this plain-and-simple BUG would have survived so long! Super.
Comment 46•10 months ago
|
||
First: Thanks for all the work!
I would like to add my plea for implementing one of the two solutions that allow deleting attachments: My Thunderbird folder already exceeds 6 GB even without attachments and deleting my client's e-mails just because they happened to both sign them and attach a few megabytes of only temporary use is not really an option, is it?
Comment 47•5 months ago
|
||
One of our suppliers started signing all his e-mails (with an invalid signature anyway!), and I cannot delete the attachments anymore. This is still really annoying after 20 years!
Comment 48•5 months ago
|
||
Somebody mentioned above that KMail should be able to delete attachments from signed e-mails. Installing KMail would however pull loads of KDE dependencies which I don't really want, so I just Evolution 3.44.4-0ubuntu2, which comes with Ubuntu MATE 22.04.
If you delete an attached text file, Evolution replaces its contents with this text line:
File "filename.txt" has been removed.
That is, it does not really completely remove the attachment like Thunderbird does, but it should reduce its size drastically.
However, I couldn't remove an attached PDF from a signed e-mail with Evolution. There was no error message, but the removal just didn't work.
That is similar to the behaviour of Thunderbird's add-on "Attachment Extractor": it does not remove the attachments of signed e-mails, but it does not complain either. It just fails silently. I am guessing that this add-on is just a convenience wrapper to apply Thunderbird's attachment removal logic to many e-mails at once.
I would be grateful if anybody else could mention some other e-mail client, add-on or command-line tool which could delete attached files from signed e-mails.
Comment 49•5 months ago
|
||
I had a brief look.
Our existing code doesn't work for signed messages.
When allowing to execute our code on a signed message, we create a corrupted message structure, where the plain/html message part is appended at the end of the message structure - after the trailing MIME layer boundary. As a result, those text is no longer shown.
This was with the simple signature structure that uses MIME layering.
Someone would have to write new code for rewriting such messages.
And that code would have to handle both the simple MIME layering (where the original MIME text is directly visible inside the message, and an additional signature part is present ) and also the opaque signing transport mechanism (where a single MIME part contains the transported data inside a binary encoding).
This isn't deliberately preventing anyone from using the feature, it's because nobody has written the code that would be required to implement deatching/deleting for signed messages.
Comment 50•5 months ago
|
||
(In reply to R. Diez from comment #48)
I would be grateful if anybody else could mention some other e-mail client, add-on or command-line tool which could delete attached files from signed e-mails.
I'd suggest FairEmail to delete attachments in signed emails. It works flawlessly and it is open source.
Comment 51•5 months ago
|
||
(In reply to Bob G from comment #50)
(In reply to R. Diez from comment #48)
I would be grateful if anybody else could mention some other e-mail client, add-on or command-line tool which could delete attached files from signed e-mails.
I'd suggest FairEmail to delete attachments in signed emails. It works flawlessly and it is open source.
Nice - as long as one has access to an Android phone and FairEmail can get hold of the email,
which is not the case for non-standard (M$ Exchange) accounts.
As I wrote here 8 years back: https://bugzilla.mozilla.org/show_bug.cgi?id=288700#c32
here is a basic workaround I came up with many years before - shame this issue is way too old!
Use any tool or editor capable of manipulating the email (header), e.g., the "Header Tools Improved" add-on
- Change in the "Content-Type" header entry the "multipart/signed" to "multipart/mixed" and rename the "protocol" parameter, e.g.:
replace
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature";
by
Content-Type: multipart/mixed; protocol="application/x-pkcs7-disabled-signature";
Then the email will no more be considered signed and the signature will show up as an additional attachment that can be ignored.
Now the email attachments can deleted/detached as usual.
Comment 52•5 months ago
|
||
(In reply to Kai Engert (:KaiE:) from comment #49)
Someone would have to write new code for rewriting such messages.
And that code would have to handle both the simple MIME layering (where the original MIME text is directly visible inside the message, and an additional signature part is present ) and also the opaque signing transport mechanism (where a single MIME part contains the transported data inside a binary encoding).
As I wrote 8 years back, the simple workaround I just shared again indicates that it cannot be that hard to implement a fix within TB.
Comment 53•5 months ago
|
||
(In reply to Kai Engert (:KaiE:) from comment #49)
I had a brief look.
[...]
Thanks for looking.
An alternative could be to provide a way to remove the digital signature from an e-mail as a first step. Afterwards, the normal logic to delete attachments should work.
There is a Thunderbird add-on called "Disable Signature" for that purpose, but it is not compatible with modern Thunderbird versions. I am guessing that its source code could also be used as inspiration.
Some people are using invalid signatures, or one which requires manually installing some certificate which you may not want to actually install and trust. Therefore, an option to only remove the digital signature may be useful in other scenarios too.
Comment 54•5 months ago
|
||
(In reply to David von Oheimb from comment #51)
As I wrote here 8 years back
Thanks for the reminder. I decided to test your method, and this is what I found:
- Searching for add-on "Header Tools Improved" within Thunderbird provided no hits.
I am using Thunderbird version 115, which comes with Ubuntu MATE 22.04. Thunderbird version 115 is not actually very old: it was released on September 5 2024 (about 18 days ago), and there is only a newer version, namely Thunderbird128.
However, searching for add-on "Header Tools Improved" on the Internet did show version 4.7, which should be compatible with my Thunderbird (compatible with versions 115.0 - 125.*).
I manually installed that version, and the add-on seemed to work fine.
On addons.thunderbird.net, I clicked on other versions, and I then saw a new one labelled "version 4.8", compatible with "Thunderbird 126.0 - 132.*". That is probably the reason why Thunderbird was not showing the add-on at all. This is all very confusing.
-
Menu item "Header Tools Improved" only shows up in the context-menu, and only in the message pane. If you open the e-mail in a separate window, like I tend to do, then there is no way to access the add-on. The shortcoming with the pop-up menu is actually documented: "Due to changes in Thunderbird this add-on now only works with messages opened in the Message Pane. The Message and Message list context menus only appear when a message is visible in the Message Pane. The Message menu submenu had to be removed."
-
Option "Change header details" is not enough, you have to use "Edit full source".
There is no find function in the text editor, so you have to visually scan for the "application/pkcs7-signature" you mention. In the particular e-mail I tried this with, there were quite a few headers to go through.
- The e-mail had been sent from some Apple Mail software. Instead of "application/x-pkcs7-signature", the Content Type was "application/pkcs7-signature" (without the "x").
This procedure is definitely not for the average Thunderbird user.
Other than that, your procedure did work. After making the change to the content type line, an additional attachment called "smime.p7s" appeared. I was then able to delete both the original attachment and smime.p7s too.
Comment 55•5 months ago
•
|
||
deleted
Comment 56•5 months ago
|
||
I deleted comment 55 because it was an incorrect statement.
I confirm the strategy described in comment 53 works.
(edit message, replace content-type, then delete attachment works, message text still readable.)
Comment 57•5 months ago
|
||
Magnus, besides the delete attachment / detach attachment functionality, are you aware of any simpler code that we have, which modifies a message and replaces its storage (either local or on the server)?
That code is rather complicated. I wonder if we have any simpler implementation (e.g. that doesn't need to go through C++).
Comment 58•5 months ago
|
||
We could potentially use the the following implementation:
When building the list of right-click-menu actions, we currently check for the signature content type. If we find it, we disable the delete/detach attachment actions.
A suggested enhanced implementation, with a minimal UI change, could do the following:
When we detect the signature content-type, we change the wording of the menu command to
"remove message signature and delete/detach".
When the user selects that, the simplest implementation could do a two-phase action.
In a first step, we transform the message content-type. I'd suggest to go through all of the message, and replace all content-types that start with multipart/signed with multipart/mixed (reusing the suggested stragegy from the earlier comments).
I think it would be sufficient to simply leave the additional attributes in place.
So the first step loads the message, changes the content-type everywhere in the message, the replaces the message in storage.
Then, as a second step, we call the existing code to delete/detatch the attachment.
If we can find a simple way to do step 1, this might be rather straightforward to implement.
Comment 59•5 months ago
|
||
Just a note to myself:
The action happens in AttachmentDeleter::InternalStartProcessing
which uses the URL parameters &del= and &detachTo= to signal which part is treated,
and the constructed streamconverter will run through mimemult.cpp, MimeMultipart_parse_line.
The code for case MimeMultipartHeaders writes a text/x-moz-deleted header.
See also obj->options->state->strippingPart
If we don't find an easy way to rewrite the existing message with different content types,
implementing this feature would require similar code that executes a similar sequence of steps,
but instead of stripping, just replacing content-type headers.
Comment 60•5 months ago
|
||
(In reply to Kai Engert (:KaiE:) from comment #57)
Magnus, besides the delete attachment / detach attachment functionality, are you aware of any simpler code that we have, which modifies a message and replaces its storage (either local or on the server)?
Not that I can think of.
However, we currently disable the menu, but is it actually not working? I thought we disabled it since it would invalidate the signature.
I wouldn't change the wording, but instead have a don't-remind-me-again warning dialog explain that this will turn this signature invalid.
Comment 61•5 months ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #60)
[...]
However, we currently disable the menu, but is it actually not working? I thought we disabled it since it would invalidate the signature.
By the way, did you just disable the menu?
If I open the signed message in a separate tab, I can open the menu "Message", "Attachments", and options "Detach..." and "Delete" are disabled for each attachment.
But options "Detach all..." and "Delete all..." are still available. However, when you try to use them, they do nothing, and there is no error message.
That is yet another small bug, but this behaviour also suggests that something in the code is disabled, and not just the menu items.
Comment 62•5 months ago
|
||
Whenever modifying a signed message (to remove an attachment or for other reason) by whatever means,
I propose keeping the signature blob in the form of an attachment as a reminder of the message originally having been signed.
Then the user has the choice to remove the signature in case (s)he is not interested in keeping it.
This is automatically fulfilled when using the mentioned simple strategy (adapting the message content type).
Comment 64•17 days ago
|
||
The current situation of not being able to delete the attachment of signed messages is problematic for the case where the attachment contains data that must be deleted, e.g. for legal reasons. Right now I am forced to delete the entire email. I'd much rather accept a "broken signature" warning (with an indication like "you removed the attachment, hence the signature can no longer be verified") or so, that would still be better than having to delete the entire email.
Comment 65•17 days ago
|
||
(Sorry for the 2nd message, I forgot to add this in my first post.)
The other issue that that currently, the UI gives no feedback as to why the items are disabled, which is quite frustrating -- the user will likely wonder whether they are doing something wrong.
Description
•