Package: thunderbird
Version: 1:91.5.0-2~deb10u1

Thunderbird is not displaying attachments that contain a slash (/) in
their name. There is also no error message.


Steps to reproduce:

- Open thunderbird to send yourself an email with an attachment, for
  example a PDF file. it is called "doc.pdf" in this example here.

- Click on the received email. Click on the attachment and see that it
  correctly opens.

- Now right click on the received mail in the mail list and do "save
  as". save the email with filename "working.eml"

- quit thunderbird.

- in a shell go in the directory where working.eml is saved and do:
  thunderbird working.eml
  You will see thunderbird starting, opening the mail. click on the
  attachment and see it opens.
  quit thundebird again.

- copy working.eml to not_working.eml
  open a text editor on not_working.eml

now search for this:

Content-Type: application/pdf; name="doc.pdf"
Content-Disposition: attachment; filename="doc.pdf"
Content-Transfer-Encoding: base64

add slashes at the same position in both filenames like this:

Content-Type: application/pdf; name="do/c.pdf"
Content-Disposition: attachment; filename="do/c.pdf"
Content-Transfer-Encoding: base64

save the file.

- now do
  thunderbird not_working.eml
  the email opens, you see the attachment named "do/c.pdf"
  you can click the attachment, but nothing opens.
  no error message, just nothing happens.
  but you can right click the attachment and save it.
  notice that thunderbird wants to save with "do-c.pdf", so it replaced
  the slash (/) by a minus (-).
  you can check that the saved file correctly matches the original file.

As you see something is wrong when receiving attachments that contain a
slash (/) in their name.

When you investigate thunderbird with strace like this:

strace -ffff thunderbird working.eml 2>strace_working.txt
then click on the attachment and quit thunderbird

then do

strace -ffff thunderbird not_working.eml 2>strace_not_working.txt
then click on the attachment and quit thunderbird

then do:
grep pdf strace_working.txt |grep open
you will see:
[pid 17250] openat(AT_FDCWD, "/tmp/doc.pdf", O_WRONLY|O_CREAT...

compare this to:
grep pdf strace_not_working.txt |grep open
you will see no try of even saving the attachment.




The way I created the not-working email with a text editor may seem
the source of the problem, but it isn't. I regularly get emails with
slashes in attachment names. I simply did not find a way to create such
an email with commandline tools. All seem to dislike slashes in
attachment names. But since I am regularly receiving this kind of
emails in real life, there must be some (non-unix?) mail program
creating such (bad) attachments.




cu
Erik

Reply via email to