Thunderbird removing PDF attachments when forwarding

User Help for Mozilla Thunderbird
Post Reply
simonas
Posts: 5
Joined: January 4th, 2021, 2:39 am

Thunderbird removing PDF attachments when forwarding

Post by simonas »

Hello,
I have PC with Windows 7, Thundebird newest version, suddenly Thunderbird stopped work correctly, if i want to forward mail with attachments, for example - 2 excel files, 1 word and 2 pdf files, after i click "Forward" all of pdf files just gone, leaves just excel and word.. this is very annoying issue... and i cant find any solution.. ?? On my Linux PC with same mailbox works everything fine, on other PC too, if i log in to server from roundcube console, also works fines.. I tried older thunderbird version, i tried complete uninstall and fresh install.. nothing can fix this problem...
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Thunderbird removing PDF attachments when forwarding

Post by tanstaafl »

I can't duplicate your problem using Thunderbird 78.6.0 and Windows 10. No problem forwarding messages with a .pdf or .png or .jpg file attachment, or a message with a .docx, .pptx and a .xlsx attachment. However I noticed that if I forward a message to my gmail account with either a .zip or .wav file attachment I don't get an error, and I never get the message. I assume that is because they're executable files.

I suggest you use view -> message source or Control-U and compare the raw message source of the message you received and what you sent. See if the received message contains the file attachment but changes the headers for that MIME section to something else (causing it to be hidden).

--------------393CD45EE0D74809EE256C7F
Content-Type: application/pdf;
name="Quick Carbon 1GCBoston Globe32215.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="Quick Carbon 1GCBoston Globe32215.pdf"

JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIv
TGFuZyhlbi1VUykgL1N0cnVjdFRyZWVSb290IDM1IDAgUi9NYXJrSW5mbzw8L01hcmtlZCB0
cnVlPj4+Pg0KZW5kb2JqDQoyIDAgb2JqDQo8PC9UeXBlL1BhZ2VzL0NvdW50IDIvS2lkc1sg

for example has a boundary string used to separate that MIME section, followed by the headers, followed by part of the base64 encoded file. If you are forwarding a message with a .pdf file attachment you want to see a Content-Type header set to application/pdf; and a Content-Disposition: header set to attachment.

If the attachment was mis-identified as Content-Type: application/octet-stream for example that would mean its treated as a generic bunch of binary data. Normally I'd expect the attachment to be visible in that case, but Thunderbrid not call the appropriate utility to view it if you tried to open the attachment because it doesn't know what type of file it is. It uses the Content-Type header, not the file extension, to figure out what type of file it is.
simonas
Posts: 5
Joined: January 4th, 2021, 2:39 am

Re: Thunderbird removing PDF attachments when forwarding

Post by simonas »

I also dont have any problems with Windows 10 or Linux... This problem appears on one of PC with Windows 7, and as i told, didint helped fresh reinstall or older version..
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Thunderbird removing PDF attachments when forwarding

Post by tanstaafl »

Okay. Did you look at the raw message source of the message on Windows 7 (not to be confused with what you see when you open a message)?
simonas
Posts: 5
Joined: January 4th, 2021, 2:39 am

Re: Thunderbird removing PDF attachments when forwarding

Post by simonas »

------=_NextPart_000_0047_01D6E34A.5489F260
Content-Type: application/pdf;
name="doc03868020210105095456.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="doc03868020210105095456.pdf"

looks everything normal...
Stefan776
Posts: 1
Joined: January 5th, 2021, 6:18 am

Re: Thunderbird removing PDF attachments when forwarding

Post by Stefan776 »

Hello, I have a similar problem. All file extensions for received emails are renamed .. like " pd_ " for " .pdf " ... in fact the last letter of the file extension is replaced with " _ " .
And it's annoing, because I can't open any files .. unless if I rename all of them.
And when I have to forward an email wich has a file with the file extension renamed it's the same.
Can anybody help me?
Thank you!
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Thunderbird removing PDF attachments when forwarding

Post by tanstaafl »

simonas:

That looks fine. It should list the attachment unless something messed up the structure of the message so that it can't find that MIME section. The only other possibility I can think of is you have invalid MIME types information stored in your profile.

Thunderbird used to use the mimetypes.rdf file to specify what action should be used for each type of MIME section (different type of attachment). I think that has been replaced by the handlers.json file. Try exiting Thunderbird, moving that file to somewhere safe outside of the profile, and restarting Thunderbird. It should create a new version of that file with default settings. Hopefully that will let you see the .pdf attachment again, though you will have to respecify what utility should be used to open many attachments.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Thunderbird removing PDF attachments when forwarding

Post by tanstaafl »

Stefan776:

Look in your handlers.json file and see if it mentions pd_ . Mine contains just:

{"defaultHandlersVersion":{},"mimeTypes":{"image/jpeg":{"action":4,"extensions":["jpg"]},"application/pdf":{"action":4,"extensions":["pdf"]},"text/plain":{"action":4,"extensions":["txt"]},"text/html":{"action":4,"extensions":["html","htm","shtml","ehtml"]}},"schemes":{"http":{"action":4},"https":{"action":4}}}

Notice it specifies a pdf file extension should be used for a "application/pdf" MIME type, not pd_ . That is also consistent with Thunderbird using my windows system default handler for PDF files (Nitro Reader 5).

You might need to delete your handlers.json file and let it replace it with one with default values.
sfhowes
Posts: 748
Joined: April 1st, 2012, 10:21 am

Re: Thunderbird removing PDF attachments when forwarding

Post by sfhowes »

Stefan776 wrote:Hello, I have a similar problem. All file extensions for received emails are renamed .. like " pd_ " for " .pdf " ... in fact the last letter of the file extension is replaced with " _ " .
And it's annoing, because I can't open any files .. unless if I rename all of them.
And when I have to forward an email wich has a file with the file extension renamed it's the same.
Can anybody help me?
Thank you!
This is usually caused by Kaspersky attachment filtering.

https://support.kaspersky.com/KS4MO365/ ... 177819.htm
simonas
Posts: 5
Joined: January 4th, 2021, 2:39 am

Re: Thunderbird removing PDF attachments when forwarding

Post by simonas »

As i told, i done FRESH installation of older and newest version of thunderbird... That didint helped, why should help this method ? I see all attachments fine, and works fine, the problem is only when i want to forward email with pdf... there are just vanishing somehow..
tanstaafl wrote:simonas:

That looks fine. It should list the attachment unless something messed up the structure of the message so that it can't find that MIME section. The only other possibility I can think of is you have invalid MIME types information stored in your profile.

Thunderbird used to use the mimetypes.rdf file to specify what action should be used for each type of MIME section (different type of attachment). I think that has been replaced by the handlers.json file. Try exiting Thunderbird, moving that file to somewhere safe outside of the profile, and restarting Thunderbird. It should create a new version of that file with default settings. Hopefully that will let you see the .pdf attachment again, though you will have to respecify what utility should be used to open many attachments.
User avatar
DanRaisch
Moderator
Posts: 127186
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: Thunderbird removing PDF attachments when forwarding

Post by DanRaisch »

simonas wrote:As i told, i done FRESH installation of older and newest version of thunderbird... That didint helped, why should help this method ? I see all attachments fine, and works fine, the problem is only when i want to forward email with pdf... there are just vanishing somehow.
Did you review the information posted by sfhowes?
simonas
Posts: 5
Joined: January 4th, 2021, 2:39 am

Re: Thunderbird removing PDF attachments when forwarding

Post by simonas »

DanRaisch wrote:
simonas wrote:As i told, i done FRESH installation of older and newest version of thunderbird... That didint helped, why should help this method ? I see all attachments fine, and works fine, the problem is only when i want to forward email with pdf... there are just vanishing somehow.
Did you review the information posted by sfhowes?
Yes, there is no kaspersky software on that PC
parapente10
Posts: 2
Joined: May 26th, 2021, 2:19 am

Re: Thunderbird removing PDF attachments when forwarding

Post by parapente10 »

I seem to have the same problem with a pc running windows 7. I tried removing handlers.json or even copying mimeTypes.rdf from another pc but doesn't solve the problem. Did you have any luck figuring out what might be the problem simonas? Thunderbird seems to have a problem only with pdf files as attachments. The antivirus running on the pc is Avast. I tried uninstalling every program that handles pdf (pdfsam, pdf24 and acrobat reader) and disabling the antivirus but the problem persists.
parapente10
Posts: 2
Joined: May 26th, 2021, 2:19 am

Re: Thunderbird removing PDF attachments when forwarding

Post by parapente10 »

In case someone stumbles upon this topic, it is linked to this bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1589890

If you look at the last comment you will see that if there are leftover nsemail.pdf files in the temp directory (nsemail-1.pdf to nsemail-9999.pdf) thunderbird will not be able to create another temporary file and as a result the pdf files are not appearing as attachments when forwarding emails. The same can happen with other filetypes of course. To solve the problem you just need to delete the nsemail files from the C:\Users\<username>\AppData\Local\Temp folder. Be sure to close thunderbird before deleting those files.
User avatar
makaiguy
Posts: 16878
Joined: November 18th, 2002, 6:44 pm
Location: Somewhere in SE USA
Contact:

Re: Thunderbird removing PDF attachments when forwarding

Post by makaiguy »

parapente10 wrote:In case someone stumbles upon this topic, it is linked to this bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1589890

If you look at the last comment you will see that if there are leftover nsemail.pdf files in the temp directory (nsemail-1.pdf to nsemail-9999.pdf) thunderbird will not be able to create another temporary file and as a result the pdf files are not appearing as attachments when forwarding emails. The same can happen with other filetypes of course. To solve the problem you just need to delete the nsemail files from the C:\Users\<username>\AppData\Local\Temp folder. Be sure to close thunderbird before deleting those files.
Very helpful. Thanks for posting this.
Doug Wilson
Win10 64bit: FF 115.0.02 64bit, TB 102.12.0 32-bit ║ Android 13/10: FF 115.2.0/115.0.1 ║ No TB for Android available, dammit!
What a fool believes he sees, no wise man has the power to reason away - Doobie Brothers
Post Reply