nsemail and nscopy files left in /tmp

Bug #1853007 reported by Alistair Cunningham on 2019-11-18
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
Confirmed
Medium
thunderbird (Ubuntu)
Low
Unassigned

Bug Description

thunderbird leaves nsemail and nscopy files in /tmp:

# ls -l /tmp/ns*
-rw------- 1 alistair alistair 5522 Nov 18 08:42 /tmp/nscopy-1.tmp
-rw------- 1 alistair alistair 8883 Nov 18 08:43 /tmp/nscopy-2.tmp
-rw------- 1 alistair alistair 8311 Nov 18 08:49 /tmp/nscopy-3.tmp
-rw------- 1 alistair alistair 3455 Nov 18 08:38 /tmp/nscopy.tmp
-rw------- 1 alistair alistair 25790 Nov 15 09:26 /tmp/nsemail-10.eml
-rw------- 1 alistair alistair 5840 Nov 15 09:28 /tmp/nsemail-11.eml
-rw------- 1 alistair alistair 25442 Nov 15 09:29 /tmp/nsemail-12.eml
-rw------- 1 alistair alistair 2838 Nov 15 09:29 /tmp/nsemail-13.eml
-rw------- 1 alistair alistair 8556 Nov 15 10:10 /tmp/nsemail-14.eml
-rw------- 1 alistair alistair 1659 Nov 15 10:32 /tmp/nsemail-15.eml
-rw------- 1 alistair alistair 3240 Nov 15 10:47 /tmp/nsemail-16.eml
-rw------- 1 alistair alistair 3260 Nov 15 10:57 /tmp/nsemail-17.eml
-rw------- 1 alistair alistair 107975 Nov 15 13:43 /tmp/nsemail-18.eml
-rw------- 1 alistair alistair 4878 Nov 15 13:44 /tmp/nsemail-19.eml
-rw------- 1 alistair alistair 21150 Nov 13 08:43 /tmp/nsemail-1.eml
-rw------- 1 alistair alistair 2974 Nov 18 08:41 /tmp/nsemail-1.html
-rw------- 1 alistair alistair 6328 Nov 15 13:45 /tmp/nsemail-20.eml
-rw------- 1 alistair alistair 134689 Nov 15 13:49 /tmp/nsemail-21.eml
-rw------- 1 alistair alistair 2733 Nov 15 17:15 /tmp/nsemail-22.eml
-rw------- 1 alistair alistair 53857 Nov 16 09:23 /tmp/nsemail-23.eml
-rw------- 1 alistair alistair 89392 Nov 16 09:39 /tmp/nsemail-24.eml
-rw------- 1 alistair alistair 80120 Nov 17 10:52 /tmp/nsemail-25.eml
-rw------- 1 alistair alistair 6361 Nov 17 18:45 /tmp/nsemail-26.eml
-rw------- 1 alistair alistair 3455 Nov 18 08:38 /tmp/nsemail-27.eml
-rw------- 1 alistair alistair 5522 Nov 18 08:41 /tmp/nsemail-28.eml
-rw------- 1 alistair alistair 8883 Nov 18 08:43 /tmp/nsemail-29.eml
-rw------- 1 alistair alistair 29937 Nov 13 09:37 /tmp/nsemail-2.eml
-rw------- 1 alistair alistair 5057 Nov 18 08:43 /tmp/nsemail-2.html
-rw------- 1 alistair alistair 8311 Nov 18 08:49 /tmp/nsemail-30.eml
-rw------- 1 alistair alistair 2015 Nov 13 09:40 /tmp/nsemail-3.eml
-rw------- 1 alistair alistair 4949 Nov 18 08:49 /tmp/nsemail-3.html
-rw------- 1 alistair alistair 183446 Nov 14 08:48 /tmp/nsemail-4.eml
-rw------- 1 alistair alistair 59817 Nov 15 08:41 /tmp/nsemail-5.eml
-rw------- 1 alistair alistair 9751 Nov 15 08:47 /tmp/nsemail-6.eml
-rw------- 1 alistair alistair 2967 Nov 15 08:49 /tmp/nsemail-7.eml
-rw------- 1 alistair alistair 2983 Nov 15 08:54 /tmp/nsemail-8.eml
-rw------- 1 alistair alistair 19780 Nov 15 09:14 /tmp/nsemail-9.eml
-rw------- 1 alistair alistair 27900 Nov 13 08:34 /tmp/nsemail.eml
-rw------- 1 alistair alistair 1317 Nov 18 08:38 /tmp/nsemail.html
-rw------- 1 alistair alistair 1115 Nov 18 08:41 /tmp/nsmail-1.tmp
-rw------- 1 alistair alistair 2424 Nov 18 08:43 /tmp/nsmail-2.tmp
-rw------- 1 alistair alistair 2000 Nov 18 08:49 /tmp/nsmail-3.tmp
-rw------- 1 alistair alistair 967 Nov 18 08:38 /tmp/nsmail.tmp

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: thunderbird 1:68.1.2+build1-0ubuntu1
ProcVersionSignature: Ubuntu 5.3.0-19.20-generic 5.3.1
Uname: Linux 5.3.0-19-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
AddonCompatCheckDisabled: False
ApportVersion: 2.20.11-0ubuntu8.2
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: alistair 2211 F.... pulseaudio
BuildID: 20191010144232
Channel: Unavailable
Date: Mon Nov 18 08:50:15 2019
ForcedLayersAccel: False
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
 dns-search integrics.com
InstallationDate: Installed on 2017-08-16 (823 days ago)
InstallationMedia: Ubuntu 17.04 "Zesty Zapus" - Release amd64 (20170412)
IpRoute:
 default via 1.0.0.1 dev wlp58s0 proto dhcp metric 600
 1.0.0.0/21 dev wlp58s0 proto kernel scope link src 1.0.1.146 metric 600
 169.254.0.0/16 dev wlp58s0 scope link metric 1000
NoProfiles: True
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
RunningIncompatibleAddons: False
SourcePackage: thunderbird
UpgradeStatus: Upgraded to eoan on 2019-10-04 (44 days ago)
dmi.bios.date: 08/30/2019
dmi.bios.vendor: LENOVO
dmi.bios.version: N1WET56W (1.35 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20HFCTO1WW
dmi.board.vendor: LENOVO
dmi.board.version: Not Defined
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.modalias: dmi:bvnLENOVO:bvrN1WET56W(1.35):bd08/30/2019:svnLENOVO:pn20HFCTO1WW:pvrThinkPadT470s:rvnLENOVO:rn20HFCTO1WW:rvrNotDefined:cvnLENOVO:ct10:cvrNone:
dmi.product.family: ThinkPad T470s
dmi.product.name: 20HFCTO1WW
dmi.product.sku: LENOVO_MT_20HF_BU_Think_FM_ThinkPad T470s
dmi.product.version: ThinkPad T470s
dmi.sys.vendor: LENOVO

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0

Steps to reproduce:

Version: 68.1.2 (64-bit) Linux
Open Thunderbird, read, respond, write new messages.

Actual results:

Depending on the session activity, lots of files left in /tmp. Typical files:
nscopy.tmp
nsemail-1.eml
nsemail-2.eml
nsemail.eml
nsemail.html
nsmail.tmp

These files are owner read/write only. If left alone, more such files accumulate during each Thunderbird session. Not a priority, just somewhat sloppy, like a memory leak.

Expected results:

Those files should have been deleted upon each session close.

Hmm, interesting. I played with temporary files in bug 1568896 comment #8 on Windows. They all got cleaned up when TB closed. That's not the case on Linux?

No, Jorg, not on Linux. Before I suggested that it might be a bug, I planned to write a script around Thunderbird to "rm /tmp/ns*" upon exit. This morning I found these. nsemail-0,1,2,3 were from yesterday, the rest today.
nscopy-1.tmp
nscopy-2.tmp
nscopy-3.tmp
nscopy-4.tmp
nscopy.tmp
nsemail-1.eml
nsemail-2.eml
nsemail-3.eml
nsemail-4.eml
nsemail-5.eml
nsemail-6.eml
nsemail-7.eml
nsemail-8.eml
nsemail.eml
nsmail-1.tmp
nsmail-2.tmp
nsmail-3.tmp
nsmail.tmp

(In reply to Henry Pfeil from comment #2)
> No, Jorg, not on Linux. Before I suggested that it might be a bug, I planned to write a script around Thunderbird to "rm /tmp/ns*" upon exit. This morning I found these. nsemail-0,1,2,3 were from last night, after I cleared /tmp, the rest today.
> nscopy-1.tmp
> nscopy-2.tmp
> nscopy-3.tmp
> nscopy-4.tmp
> nscopy.tmp
> nsemail-1.eml
> nsemail-2.eml
> nsemail-3.eml
> nsemail-4.eml
> nsemail-5.eml
> nsemail-6.eml
> nsemail-7.eml
> nsemail-8.eml
> nsemail.eml
> nsmail-1.tmp
> nsmail-2.tmp
> nsmail-3.tmp
> nsmail.tmp

Sorry about the double, I thought I was editing the message so you'd know the files were all created after I had deleted the ones in the original post.
The four nsmail*.tmp files are all copies of the same jpg image that I sent in one message as a lone attachment. In examining the other files, I noticed that I need to change my habit of replying to a recent message, then changing the subject and deleting the old content to create a new message, suffering from congenital indolence as I oftentimes do. I found huge reference lists of previous threads in the header. I was under the impression that a new Subject meant a new message. Apparently you can change the subject in any reply and it remains a reply to the previous message. Perhaps it is that habit that leaves behind the /tmp files?
The nscopy files are all the same message in text and html format with the attached image in mime format.
I cleared ns*, opened t-bird, sent myself a test message, then closed t-bird. These four are all from that message, in both txt and html format.
nscopy.tmp
nsemail.eml
nsemail.html
nsmail.tmp

I download the latest tarball, extract the Thunderbird folder, then move it to /usr/lib64. Would installing via a package manager change the result?

(In reply to Jorg K (GMT+2) from comment #1)
> temporary files ... all got cleaned up when TB closed.

Me too, under controlled shutdown in Windows. However my %tmp% also has a couple hundred files over a period of a few months so there must be circumstances where cleanup doesn't happen.

Anyway, among the open bugs we have https://mzl.la/2MGutmu and the last bug fixed was perhaps Bug 235432 - Mailnews/Thunderbird leaves unused nsqmail.tmp (nsqmail-*.tmp, nsemail.eml) files in temporary folder (TEMP or /tmp) after quit

OK, I spontaneously checked C:\Users\jorgk\AppData\Local\Temp and found four left-over temp files :-(
nsemail.eml with versions -1 and -2 and a nsmail.eml. The former three only contained headers, the latter one contained a message attachment, so message which I had sent out as an attachment. So yes, there must be some hole somewhere.

Yeah I see the nsmail tmp files too. I also thought we put those in a per-user subdir of tmp at some point, or was that only for opened attachments?

(In reply to Magnus Melin [:mkmelin] from comment #7)
> Yeah I see the nsmail tmp files too. I also thought we put those in a per-user subdir of tmp at some point, or was that only for opened attachments?

A number of issues have been fixed over the years: https://mzl.la/34uiBKd
And some not: https://mzl.la/2Nc90lr

Olivier Tilloy (osomon) wrote :

Are you sure those files remain in /tmp after exiting thunderbird?

I just tested this locally, when composing an e-mail a file /tmp/nsemail.eml was created, but after I exited thunderbird it was deleted.

Changed in thunderbird (Ubuntu):
status: New → Incomplete

Exiting and restarting thunderbird seems to remove the nscopy* files, but the nsemail* files remain (see below). In any case, restarting thunderbird isn't really a solution, because leaving thunderbird running for extended periods is a perfectly normal thing to do.

# ls -l /tmp/ns*
-rw------- 1 alistair alistair 25790 Nov 15 09:26 /tmp/nsemail-10.eml
-rw------- 1 alistair alistair 5840 Nov 15 09:28 /tmp/nsemail-11.eml
-rw------- 1 alistair alistair 25442 Nov 15 09:29 /tmp/nsemail-12.eml
-rw------- 1 alistair alistair 2838 Nov 15 09:29 /tmp/nsemail-13.eml
-rw------- 1 alistair alistair 8556 Nov 15 10:10 /tmp/nsemail-14.eml
-rw------- 1 alistair alistair 1659 Nov 15 10:32 /tmp/nsemail-15.eml
-rw------- 1 alistair alistair 3240 Nov 15 10:47 /tmp/nsemail-16.eml
-rw------- 1 alistair alistair 3260 Nov 15 10:57 /tmp/nsemail-17.eml
-rw------- 1 alistair alistair 107975 Nov 15 13:43 /tmp/nsemail-18.eml
-rw------- 1 alistair alistair 4878 Nov 15 13:44 /tmp/nsemail-19.eml
-rw------- 1 alistair alistair 21150 Nov 13 08:43 /tmp/nsemail-1.eml
-rw------- 1 alistair alistair 6328 Nov 15 13:45 /tmp/nsemail-20.eml
-rw------- 1 alistair alistair 134689 Nov 15 13:49 /tmp/nsemail-21.eml
-rw------- 1 alistair alistair 2733 Nov 15 17:15 /tmp/nsemail-22.eml
-rw------- 1 alistair alistair 53857 Nov 16 09:23 /tmp/nsemail-23.eml
-rw------- 1 alistair alistair 89392 Nov 16 09:39 /tmp/nsemail-24.eml
-rw------- 1 alistair alistair 80120 Nov 17 10:52 /tmp/nsemail-25.eml
-rw------- 1 alistair alistair 6361 Nov 17 18:45 /tmp/nsemail-26.eml
-rw------- 1 alistair alistair 3455 Nov 18 08:38 /tmp/nsemail-27.eml
-rw------- 1 alistair alistair 5522 Nov 18 08:41 /tmp/nsemail-28.eml
-rw------- 1 alistair alistair 8883 Nov 18 08:43 /tmp/nsemail-29.eml
-rw------- 1 alistair alistair 29937 Nov 13 09:37 /tmp/nsemail-2.eml
-rw------- 1 alistair alistair 8311 Nov 18 08:49 /tmp/nsemail-30.eml
-rw------- 1 alistair alistair 7385 Nov 18 08:54 /tmp/nsemail-31.eml
-rw------- 1 alistair alistair 2015 Nov 13 09:40 /tmp/nsemail-3.eml
-rw------- 1 alistair alistair 183446 Nov 14 08:48 /tmp/nsemail-4.eml
-rw------- 1 alistair alistair 59817 Nov 15 08:41 /tmp/nsemail-5.eml
-rw------- 1 alistair alistair 9751 Nov 15 08:47 /tmp/nsemail-6.eml
-rw------- 1 alistair alistair 2967 Nov 15 08:49 /tmp/nsemail-7.eml
-rw------- 1 alistair alistair 2983 Nov 15 08:54 /tmp/nsemail-8.eml
-rw------- 1 alistair alistair 19780 Nov 15 09:14 /tmp/nsemail-9.eml
-rw------- 1 alistair alistair 27900 Nov 13 08:34 /tmp/nsemail.eml

Olivier Tilloy (osomon) wrote :

> leaving thunderbird running for extended periods is a perfectly
> normal thing to do

Arguably, so is leaving files in /tmp while the application is running.

Leaving files around (containing potentially sensitive information such as e-mail contents) after the application has exited, though, is not something I would expect.

May I suggest you file an upstream bug at https://bugzilla.mozilla.org/enter_bug.cgi#h=dupes%7CThunderbird and share the link to it here? Thanks!

Surely leaving temporary files in a public directory for emails composed many days ago and which have long been sent is not an elegant or well engineered thing to do?

In any case, this only started happening after upgrading to Ubuntu 19.10.

Download full text (3.2 KiB)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

Upon upgrading to Ubuntu 19.10, thunderbird leaves nsemail and nscopy files in /tmp:

# ls -l /tmp/ns*
-rw------- 1 alistair alistair 5522 Nov 18 08:42 /tmp/nscopy-1.tmp
-rw------- 1 alistair alistair 8883 Nov 18 08:43 /tmp/nscopy-2.tmp
-rw------- 1 alistair alistair 8311 Nov 18 08:49 /tmp/nscopy-3.tmp
-rw------- 1 alistair alistair 3455 Nov 18 08:38 /tmp/nscopy.tmp
-rw------- 1 alistair alistair 25790 Nov 15 09:26 /tmp/nsemail-10.eml
-rw------- 1 alistair alistair 5840 Nov 15 09:28 /tmp/nsemail-11.eml
-rw------- 1 alistair alistair 25442 Nov 15 09:29 /tmp/nsemail-12.eml
-rw------- 1 alistair alistair 2838 Nov 15 09:29 /tmp/nsemail-13.eml
-rw------- 1 alistair alistair 8556 Nov 15 10:10 /tmp/nsemail-14.eml
-rw------- 1 alistair alistair 1659 Nov 15 10:32 /tmp/nsemail-15.eml
-rw------- 1 alistair alistair 3240 Nov 15 10:47 /tmp/nsemail-16.eml
-rw------- 1 alistair alistair 3260 Nov 15 10:57 /tmp/nsemail-17.eml
-rw------- 1 alistair alistair 107975 Nov 15 13:43 /tmp/nsemail-18.eml
-rw------- 1 alistair alistair 4878 Nov 15 13:44 /tmp/nsemail-19.eml
-rw------- 1 alistair alistair 21150 Nov 13 08:43 /tmp/nsemail-1.eml
-rw------- 1 alistair alistair 2974 Nov 18 08:41 /tmp/nsemail-1.html
-rw------- 1 alistair alistair 6328 Nov 15 13:45 /tmp/nsemail-20.eml
-rw------- 1 alistair alistair 134689 Nov 15 13:49 /tmp/nsemail-21.eml
-rw------- 1 alistair alistair 2733 Nov 15 17:15 /tmp/nsemail-22.eml
-rw------- 1 alistair alistair 53857 Nov 16 09:23 /tmp/nsemail-23.eml
-rw------- 1 alistair alistair 89392 Nov 16 09:39 /tmp/nsemail-24.eml
-rw------- 1 alistair alistair 80120 Nov 17 10:52 /tmp/nsemail-25.eml
-rw------- 1 alistair alistair 6361 Nov 17 18:45 /tmp/nsemail-26.eml
-rw------- 1 alistair alistair 3455 Nov 18 08:38 /tmp/nsemail-27.eml
-rw------- 1 alistair alistair 5522 Nov 18 08:41 /tmp/nsemail-28.eml
-rw------- 1 alistair alistair 8883 Nov 18 08:43 /tmp/nsemail-29.eml
-rw------- 1 alistair alistair 29937 Nov 13 09:37 /tmp/nsemail-2.eml
-rw------- 1 alistair alistair 5057 Nov 18 08:43 /tmp/nsemail-2.html
-rw------- 1 alistair alistair 8311 Nov 18 08:49 /tmp/nsemail-30.eml
-rw------- 1 alistair alistair 2015 Nov 13 09:40 /tmp/nsemail-3.eml
-rw------- 1 alistair alistair 4949 Nov 18 08:49 /tmp/nsemail-3.html
-rw------- 1 alistair alistair 183446 Nov 14 08:48 /tmp/nsemail-4.eml
-rw------- 1 alistair alistair 59817 Nov 15 08:41 /tmp/nsemail-5.eml
-rw------- 1 alistair alistair 9751 Nov 15 08:47 /tmp/nsemail-6.eml
-rw------- 1 alistair alistair 2967 Nov 15 08:49 /tmp/nsemail-7.eml
-rw------- 1 alistair alistair 2983 Nov 15 08:54 /tmp/nsemail-8.eml
-rw------- 1 alistair alistair 19780 Nov 15 09:14 /tmp/nsemail-9.eml
-rw------- 1 alistair alistair 27900 Nov 13 08:34 /tmp/nsemail.eml
-rw------- 1 alistair alistair 1317 Nov 18 08:38 /tmp/nsemail.html
-rw------- 1 alistair alistair 1115 Nov 18 08:41 /tmp/nsmail-1.tmp
-rw------- 1 alistair alistair 2424 Nov 18 08:43 /tmp/nsmail-2.tmp
-rw------- 1 alistair alistair 2000 Nov 18 08:49 /tmp/nsmail-3.tmp
-rw------- 1 alistair alistair 967 Nov 18 08:38 /tmp/nsmail.tmp

I reported this to the Ubuntu package...

Read more...

Olivier Tilloy (osomon) wrote :

I agree with your comment, let's see what upstream has to say. Thanks for the bug.

Changed in thunderbird (Ubuntu):
status: Incomplete → New
Changed in thunderbird:
importance: Unknown → Medium
status: Unknown → New

bug 58979 suggests the use of a subdir.

One open bug is Bug 368380 - lots of temp files left around

In the intervening years, the following have been fixed (Plus some tmp bugs not related to sending mail - compact, etc)
Bug 235432 TB13 - Mailnews/Thunderbird leaves unused nsqmail.tmp (nsqmail-*.tmp, nsemail.eml) files in temporary folder (TEMP or /tmp) after quit
Bug 299655 TB15 - /tmp files left behind, some world-readable

These bugs have comments from some users that their issue was not fixed.

*** This bug has been marked as a duplicate of bug 1589890 ***

*** Bug 1597294 has been marked as a duplicate of this bug. ***

Changed in thunderbird (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Changed in thunderbird:
status: New → Invalid
Paul White (paulw2u) wrote :

Changing upstream bug link as original marked as a duplicate

Changed in thunderbird:
importance: Medium → Unknown
status: Invalid → Unknown

This has been marked as a duplicate of bug 1589890, but bug 1589890 seems to be completely unrelated. Can anyone please explain what bug 1589890 has to do with this?

Paul White (paulw2u) wrote :

Alistair, Launchpad translates "bug" and a number as a link to a Launchpad bug report. In comment #9 incorrectly.

https://bugzilla.mozilla.org/show_bug.cgi?id=1589890 is the relevant duplicate report.

Changed in thunderbird:
importance: Unknown → Medium
status: Unknown → New

Paul, I see. Thank you.

*** Bug 1602759 has been marked as a duplicate of this bug. ***

i can confirm this behavior in Linux. i am running same version as reporter on debian unstable (bug 1602759). i would add that those files contain copies of sent emails. sometimes spotted even plain text where the sent email was encrypted. i tried running `thunderbird --verbose` but it did not help revealing more info. i tried `thunderbird -g` but thunderbird-dbgsym seems to be missing from debian.

Is there any news on fixing this?

This bug still happens on Ubuntu 20.04 beta running Thunderbird 1:68.7.0+build1-0ubuntu1.

Olivier Tilloy (osomon) wrote :

This has been confirmed to be an upstream bug, so I recommend discussing it and testing/confirming fixes there.

Confirming problem on Thunderbird 68.7.0 (32-bit) on Windows7.

Scary part is that I am not entirely sure that I was running Thunderbird when the files went into the temp-folder.

The files "nsemail.eml" to "nsemail-10.eml" contain emails I have sent the last months. I have had no reason to open them lately, so it feels like someone is spying on me.

Same here, Ubutnu 20.04 LTS with their Thunderbird 68.7.0

Isn't it a security issue that plain text is persisted on disk ?

I consider this a memory leak and/or design flaw. My feeble understanding of Thunderbird innards suggests that these files might be created to form the final message that is sent? If so, they should be deleted once the message is sent and the copy is in the Sent folder. They should exist only on the POP or IMAP server and ~/.thunderbird. Use of the file system should be restricted to the user's ~/.thunderbird folder, then deleted when finished. I don't know where the files appear on Windows 10, but in any case, delete any temporary files you need to create.

In case the system crashes or is shut off while Thunderbird is active, the next time Thunderbird gets launched those temporary files from the previous session could be used to reconstruct the interrupted message, should the user wish to retrieve it. The current design places permanent files in a location meant for temporary files.

Confirm this bug on Gentoo x86_64, thunderbird-bin 68.8.0.

Michael Hass (ccmha) wrote :

Still valid. On a system with lots of Users, there are thousands of mails left which all go in the backup. Why can't you just have them automatically deleted after sending them - or at least some kind of encrypted!

It is not just Linux issue. Happens on Windows also. At Windows 10 2004, Thunderbird 78.2.2 (but was also previous versions (68).

I am seeing the same on my Windows 10 Pro 2004.
Thunderbird 78.3.2
Location of the nsemail & nsmail
C:\Users\Name\AppData\Local\Temp

Example of what I am seeing.
nsemail.eml
nsemail-1.eml
thru nsemail-10.eml

There are also nsmail.pdf, nsmail.mp4, nsmail.tmp, nsmail-1.pdf etc.

They are not being deleted on exit.

Same issue with Thunderbird installed via snap except /tmp folder is now ~/Download/thunderbird.tmp
Lots of leftover files that never go away

Thunderbird 78.4.1
snap 2.47.1+20.10.1
snapd 2.47.1+20.10.1
series 16
ubuntu 20.10
kernel 5.8.0-26-generic

I also see a large number of ns* temporary files that Thunderbird leaves behind in `/tmp/`. This is quite annoying.

I've currently got almost 1000 ns* files there:
```
/tmp/nsemail-328.eml /tmp/nsemail-622.eml /tmp/nsmail-2.pdf
/tmp/nsemail-329.eml /tmp/nsemail-623.eml /tmp/nsmail-2.png
/tmp/nsemail-32.eml /tmp/nsemail-624.eml /tmp/nsmail-2.tmp
/tmp/nsemail-330.eml /tmp/nsemail-625.eml /tmp/nsmail-30.tmp
/tmp/nsemail-331.eml /tmp/nsemail-626.eml /tmp/nsmail-31.tmp
/tmp/nsemail-332.eml /tmp/nsemail-627.eml /tmp/nsmail-32.tmp
/tmp/nsemail-333.eml /tmp/nsemail-628.eml /tmp/nsmail-33.tmp
/tmp/nsemail-334.eml /tmp/nsemail-629.eml /tmp/nsmail-34.tmp
/tmp/nsemail-335.eml /tmp/nsemail-62.eml /tmp/nsmail-3.eml
/tmp/nsemail-336.eml /tmp/nsemail-630.eml /tmp/nsmail-3.jpeg
/tmp/nsemail-337.eml /tmp/nsemail-631.eml /tmp/nsmail-3.pdf
/tmp/nsemail-338.eml /tmp/nsemail-632.eml /tmp/nsmail-3.tmp
/tmp/nsemail-339.eml /tmp/nsemail-633.eml /tmp/nsmail-4.eml
/tmp/nsemail-33.eml /tmp/nsemail-634.eml /tmp/nsmail-4.jpeg
/tmp/nsemail-340.eml /tmp/nsemail-635.eml /tmp/nsmail-4.pdf
/tmp/nsemail-341.eml /tmp/nsemail-636.eml /tmp/nsmail-4.tmp
/tmp/nsemail-342.eml /tmp/nsemail-637.eml /tmp/nsmail-5.eml
/tmp/nsemail-343.eml /tmp/nsemail-638.eml /tmp/nsmail-5.jpeg
/tmp/nsemail-344.eml /tmp/nsemail-639.eml /tmp/nsmail-5.pdf
/tmp/nsemail-345.eml /tmp/nsemail-63.eml /tmp/nsmail-5.tmp
/tmp/nsemail-346.eml /tmp/nsemail-640.eml /tmp/nsmail-6.eml
/tmp/nsemail-347.eml /tmp/nsemail-641.eml /tmp/nsmail-6.jpeg
/tmp/nsemail-348.eml /tmp/nsemail-642.eml /tmp/nsmail-6.pdf
/tmp/nsemail-349.eml /tmp/nsemail-643.eml /tmp/nsmail-6.tmp
/tmp/nsemail-34.eml /tmp/nsemail-644.eml /tmp/nsmail-7.jpeg
/tmp/nsemail-350.eml /tmp/nsemail-645.eml /tmp/nsmail-7.pdf
/tmp/nsemail-351.eml /tmp/nsemail-646.eml /tmp/nsmail-7.tmp
/tmp/nsemail-352.eml /tmp/nsemail-647.eml /tmp/nsmail-8.pdf
/tmp/nsemail-353.eml /tmp/nsemail-648.eml /tmp/nsmail-8.tmp
/tmp/nsemail-354.eml /tmp/nsemail-649.eml /tmp/nsmail-9.pdf
/tmp/nsemail-355.eml /tmp/nsemail-64.eml /tmp/nsmail-9.tmp
/tmp/nsemail-356.eml /tmp/nsemail-650.eml /tmp/nsmail.asc
/tmp/nsemail-357.eml /tmp/nsemail-651.eml /tmp/nsmail.docx
/tmp/nsemail-358.eml /tmp/nsemail-652.eml /tmp/nsmail.eml
/tmp/nsemail-359.eml /tmp/nsemail-653.eml /tmp/nsmail.ics
/tmp/nsemail-35.eml /tmp/nsemail-654.eml /tmp/nsmail.jpeg
/tmp/nsemail-360.eml /tmp/nsemail-655.eml /tmp/nsmail.odt
/tmp/nsemail-361.eml /tmp/nsemail-656.eml /tmp/nsmail.pdf
/tmp/nsemail-362.eml /tmp/nsemail-657.eml /tmp/nsmail.png
/tmp/nsemail-363.eml /tmp/nsemail-658.eml /tmp/nsmail.tmp
/tmp/nsemail-364.eml /tmp/nsemail-659.eml /tmp/nsmail.zip
/tmp/nsemail-365.eml /tmp/nsemail-65.eml
```
This is just an excerpt. There are many more, total 989 files. And that although I've had already cleaned them up relatively recently already.

Changed in thunderbird:
status: New → Confirmed

I can confirm this as well.
This appears to be in the message sending code. I would not be surprised if saving drafts also triggers these files as saving a draft shares a lot ofg the same code as actually sending.

Today at 14:31 local time, I sent the email about building Thunderbird 85.0b3. And I have several files in tmp from that time that contain that message in various states:

```
-rw------- 1 rob rob 3959 Dec 30 14:31 key-3.asc
-rw------- 1 rob rob 78973 Dec 30 14:31 nscopy-2.tmp
-rw------- 1 rob rob 3753 Dec 30 14:31 nsemail-2.html
-rw------- 1 rob rob 78973 Dec 30 14:31 nsemail-3.eml
-rw------- 1 rob rob 46469 Dec 30 14:31 nsmail-2.tmp
-rw------- 1 rob rob 517 Dec 30 14:31 nsmail-3.tmp
```

* **key-3.asc** - This is a copy of my public key
* **nscopy-2.tmp** - The entire email, headers and all attachments as one would expect to find in a maildir/mbox file
* **nsemail-2.html** - The email body in HTML format
* **nsemail-3.eml** - The entire email, same as nscopy-2.tmp
* **nsmail-2.tmp** - The release notes that were included in the email (and html attachment, so this file is HTML)
** *nsmail-3.tmp** - The email body in plain text

Based on the files left behind, it looks like when a message is sent, the various mime parts are written out to temporary files to assemble the final message before sending. That produces nsemail-3.eml. nscopy-2.tmp is maybe because of the copy to the sent folder.

This is with Thunderbird 78.6.0.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.