Thunderbird cannot save email to SMB locations

So I am trying to get Thunderbird going and the problem I am running into is that it wont let me save an email to an SMB attached storage. I did some searching around and saw quite a few threads about general Thunderbird unable to save that is usually flatpak related, however that does not seem to be my problem here. I have tried using both the flatpak version of Thunderbird with Flatseal modifications as well as the "Zorin OS version" of Thunderbird and both have the same problem with trying to save emails to the SMB storage.

I can save an email from Thunderbird just fine to my own local storage.
I can also save other file types such as a PDF I made from a spreadsheet into the SMB attached storage. I can also save the .xlsx spreadsheet to the SMB.
I can also open other files from the SMB and resave those files after making changes.

Thunderbird wont let me save an email to SMB though. I can save an email to my computer, but even then if I try to cut or copy that saved email from local storage to the SMB it gives me the same error.

The specific error is not very helpful either, it simply says:
"Unable to save the message. Please check your file name and try again later."

I currently have the "Zorin OS version" of Thunderbird installed, not the Flatpak version, however it gives the same error either way.

Any ideas?

I haven't run this sort of setup myself, so I could be wrong on my train of thought here. But when it comes to ownership of the email for example, would it be Thunderbird being the owner technically and causing an issue that way? I'm not a user much of Thunderbird so I don't actually know how it handles this sort of thing. Hopefully someone else can give you some more knowledge on it.

Another thought I jump to is maybe the paths are getting screwed up somewhere along the lines. Perhaps creating a symlink with your shared folder so that it appears "locally" may alleviate this issue as well?

I am not sure. Is the Zorin package of Thunderbird perhaps a snap package? If yes, it would also need permissions. You can find out when you list your snaps:
"snap list".

Thunderbird can also be installed as tar.gz file or via adding the ppa of mozilla. But I don't know if that would help.

Looks like the Zorin OS version of Thunderbird installed through the software manager is an APT, not a snap, so it shouldn’t have sandboxing issues. I tried uninstalling Thunderbird from the software manage and add the mozilla ppa and install via terminal, it has the same problem with not being able to save to SMB and move an already locally saved email to the SMB. I figured it would since both are APTs but thought it worth trying with the new repository set.

I checked the permissions of the .eml file and a .pdf file and both say the owner is "me" and Group "mike" and both say read and write access, so it appears to have the same permissions on the two different file types. I even tried something stupid and renamed the .eml file to a .pdf and tried to copy it to the SMB just to see if it was some weird aversion to the file type but this still failed with the same error. lol

Possibly dumb question, but do you have your SMB share mounted, and using the mount location as where you're trying to save stuff? Or the share path itself? I don't believe it would work using the share path, it would need to be a mounted location on your system in order to function correctly (just in case this is how you're trying to do it).

Do you have prioritized the ppa after adding it?

If you want to install thunderbird from this repo you should prioritize it. Otherwise the normal version from Zorin/Ubuntu is used:

In Ubuntu 24.04 there is no longer a .deb package of Thunderbird availble (this will come soon with Zorin 18).

2 Likes

To specify that: You have added the Mozilla-own Repo or the mozillateam PPA?

Can you describe how are you mounting the SMB share, and how are you accessing?

Here you're saying that you cannot move files from your local drive to the SMB share. Is this from within Thunderbird?

Ah, I did forget to prioritise the new repository

Looks like I used the Mozillateam PPA. Which I thought was correct but upon looking at things more it seems the Mozillateam/PPA is a curated repository specifically for Ubuntu (and sort of its derivatives like Zorin?) and the Mozilla-own is the one from Mozilla itself and doesnt necessarily contain a .deb installer file as it is.

I can move other types of files, but when I tried saving an email locally, then moving it to the SMB it would give the same error as when trying to save it directly from within Thunderbird.

But! I figured out the problem.

Turns out not to be a permissions issue at all or anything with what Thunderbird application variant is used, but rather that Thunderbird on Zorin (probably all linux or at least all debian distros?) chooses to put the email the message came from in between angle brackets < > whereas all other computers that are running Thunderbird I have been using so far (windows) instead put the email inside parentheses ( ). The angle brackets break a file being allowed on an SMB share somehow. It is an allowed character on local storage, but not on SMB attached storage. There seems to be no where possible in Thunderbird to change this behavior, but I did sort of find a workaround:

Until now, I have been using my SMB attached storage by simply connecting to it with a bookmark to the location: "SMB://192.168.1.111/Network_Attached_Files". I add a bookmark to that location so it is just a click away in Files on the left side of the window. When I click on the bookmark for the first time upon booting the system mounts up the SMB storage as a network connection. At least that is what I am assuming since it shows a connection icon next to it, and has another icon that says "unmount". This is my preferred method for getting to the SMB storage, because actually using an fstab configuration and mounting the same location over SMB protocol has some drawbacks. You would think they would act the same but it does not. The fstab mounting method acts more iike a local folder than a network connected one.

The first drawback and why I don’t like the fstab method is that when I wake the computer up from sleep and log in, the mounted shares take almost 2 full minutes to show up again. Whereas just clicking the bookmarked SMB:// link lets me get to the location within a second or two. The second issue that I dont like is if the NAS server is offline for some reason, or if the network is having a problem and the NAS unreachable. In this case the Zorin OS computer will boot but the mounted share is empty, and even when the NAS becomes available again the mounted share will remain empty. I can only make the mounted share re-update and get access to the files by restarting the computer. The bookmarked SMB:// location though reconnects when the NAS becomes available and I can get to the files with no problem just by clicking on it.

Neither of those problems are something I like, which is why I have been avoiding them by simply using the bookmarked SMB location instead of fstab mounting. The problem though is that the way SMB network locations are treated in Linux wont allow file names with angle brackets to be used. If I actually mount the SMB share through fstab configuration it does allow files with angle brackets in them to be used, as the mounted location looks like local storage to the computer instead of somewhere over the network. This seems like an odd little issue, as both locations go to the same place and it is just a minor difference in how it is connecting to the system.

So it appears I will have to use the fstab mounting method going forward to allow Thunderbird to function properly, and just deal with the headaches from those two issues that come with using such a method. Or, if I can find some way to make Thunderbird not put the sender email in the file now by default when saving an email. There doesn’t seem to be any save options though to make this change.

2 Likes

Just done a couple of quick searches using A.I. and found this for Thunderbird:

"Save Thunderbird Emails to SMB

There is no direct method provided in the available context to save Thunderbird emails to an SMB share without using FSTAB. The primary methods described involve either manually saving individual emails or backing up the entire Thunderbird profile directory, which can then be copied to an external drive or network location. The context does mention a known, unresolved bug from 2015 regarding Thunderbird's inability to reliably store local folders on a Samba (SMB) share, which could cause issues like the "copy could not be saved" error and endless searching when accessing folders. This suggests that using a Samba share directly for Thunderbird's local folders may be problematic. While the context notes that users can access Samba shares via the file manager or shell commands, indicating the underlying network access works, it does not offer a workaround for Thunderbird's specific limitations with SMB shares that avoids FSTAB mounting. Therefore, based on the provided information, the recommended approach is to manually back up the Thunderbird profile to a location that is accessible via the SMB share, rather than attempting to store the profile directly on the share."

and this for Evolution:

"Save Emails to SMB in Evolution

Evolution on Ubuntu 22.04 stores email data in specific directories within the user's home folder, primarily in ~/.local/share/evolution for user data, including locally stored emails, and ~/.config/evolution for configuration settings. To back up emails to an SMB (Server Message Block) storage location, you need to copy these directories to the mounted SMB share.

First, ensure the SMB share is mounted on your Ubuntu system. You can use the mount.cifs command or the graphical file manager to connect to the SMB share and mount it to a local directory, such as ~/smb-backup .

Next, create a backup of the Evolution data. It is recommended to stop Evolution before starting the backup to prevent file corruption. You can then use the tar command to compress the necessary directories into a single archive file. For example, to create a compressed archive of the Evolution data:

tar -czvf evolution-backup.tar.gz ~/.local/share/evolution ~/.config/evolution

This command creates a evolution-backup.tar.gz file in the current directory. Once the archive is created, copy it to the mounted SMB share:

cp evolution-backup.tar.gz /path/to/mounted/smb-backup/

The ~/.local/share/evolution directory contains the actual email messages and attachments, while ~/.config/evolution holds account settings and preferences. Copying both directories ensures a complete backup. For enhanced security, especially if the backup contains sensitive information, consider encrypting the archive using GPG before transferring it to the SMB share.

Alternatively, Evolution provides a built-in backup function accessible via the File menu (File > Backup Data), which creates a .tar.gz file containing the data. This file can then be copied to the SMB share. However, this method may not include all data, such as cached files in ~/.cache/evolution , so manually copying the directories is often more comprehensive."

Oh, I see... it looks like a combination of a couple of details that aren't immediately obvious:

  1. Windows' file system (NTFS) doesn't allow angle brackets (<>) in a file name.

  2. The file manager in Zorin OS, Nautilus, uses its own internal implementation to handle various file systems, including network shares such as SMB.

When you ask any program to save a file locally, it delegates this task to the operating system, which would then take all the necessary steps to make sure it's a successful operation.

But remember that Nautilus has its own implementation which is not available system-wide. Meaning, that the OS is not aware that there's a remote file system mounted, and doesn't attempt to resolve any conflicts due to illegal characters being used.

As you found out, the only way to make that work would be to tell the system about it using the /etc/fstab. This is because there you have to specify the file system to use for that mount point, which would solve the problem.

3 Likes

I'm not sure if perhaps the addon import-export-tool-ng for thunderbird could help you:

At options>filenames there you can set the format for email export.

Here is a picture from github:

3 Likes

Ya I found that in my searching yesterday. According to "Google AI" it says that installing ImportExportTool NG addon and configuring the customised save format should actually allow Thunderbird to save in that format by default even when using the normal Save As dialog, but upon trying it that is not at all the case. Thunderbird only saves with the configured format in the addon when actually using the addon which is kinda what I expected would be the case despite what the AI said. Unfortunately, using that addon as the normal way we would save emails is not going to work as it is very cumbersome to use for individual email use. Too many people here would throw up complaints about needing to jump through the 3 extra menus every time they save something and the save dialogue not looking like a save dialogue at all. It would work great for backing up a whole folder, but not for individual messages. The fstab mounting and potential issues that brings is far more preferable to all the complaints that would happen every day using that addon method.

2 Likes

Too bad it's too cumbersome!

Hmm. The network share is formatted as ReFS rather than NTFS, but I just did some searching and it appears that ReFS has the same limitation on angle brackets in file names. Which is very odd considering the SMB share has files saved on the drive right now that contain angle brackets from my testing using the fstab mount method:

I went over to the Windows computer hosting the SMB share and when viewing those same files it appears that Windows believes the < is "scissors" and > is "a pair of glasses". So like you said, when the SMB share is mounted in the file system Nautilus is "handling it" in the background and simply changing the angle brackets to different characters without the knowledge of the user's direct involvement. Which I suppose is simply the solution I will have to go with, though I do find it curious that Thunderbird would try to use known illegal characters on some file systems by default on the Linux version of the program :man_shrugging:

They are using angle brackets because that is what the specification for what an email address is uses:

While there are other forms that could be used, as described in section 3.4.1 of that document, that form allows for characters that are also illegal to use anyway:

It's Windows that's at fault here due to this limitation, which is why Thunderbird uses another, non-standard, format for Windows. But it's hard to blame Windows for this, since it's basically impossible to accommodate every file system out there in every regard.

When working across file systems, it's always necessary to have something that can translate this little nuances on each end. Which may not always look the same or consistent depending on how it's implemented.
The file manager in Zorin OS uses it's own internal implementation at the application level, which is why it doesn't work for other programs. Mounting the drive through /etc/fstab would solve that problem by letting the OS handle this instead.

2 Likes

So as a final update to this, since it turned out to be a file naming issue rather than a Thunderbird specific saving permissions problem:

Since email clients especially but also some other programs on Linux will use what are "illegal characters" in file names for Windows formatted drives (NTFS, ReFS, FAT32, ExFAT) the best solution seemed to be to use a linux file system to store the files. This led to an issue in cloud backup, as the reason storage was still on a Windows computer was the cost of cloud storage on Linux. Storage providers simply assume you are running an enterprise server if you install their client on any Linux distro, which changes the cost for me from $120 a year on Backblaze for Windows to $43,000 a year for Backblaze on Linux, or $179,000 a year for Amazon S3 on Linux. Not happening.

So I spun up a new VM on Proxmox to run Open Media Vault, a debian based NAS distro. I wanted to use that because I wanted a BTRFS file system instead of ZFS and I like that it was Debian based like Zorin OS is. I moved the network storage I want to read/write files on from a Storage Spaces mirror on Windows 11 to a RAID 1 mirror using BTRFS on Open Media Vault. I left Windows 11 with the existing "local backup" mirror it already had that used to be a local backup target for Backblaze from the former primary storage location mirror.

I then needed a way to get the files on the new Linux network storage VM to Windows 11, and deal with the illegal characters in the process. So I made a Powershell script to do this for me. Here is the script for anyone also interested in needing to transfer files from any Linux computer to a Windows computer and fix potential file name issues in the copy process:

if (!(Test-Path -Path "E:\2025Backup")) {
    New-Item -Path "E:\2025Backup" -ItemType Directory -Force
}

$SourcePath = "\\OPENMEDIAVAULT\Test_BTRFS_Share\"

Get-ChildItem -Path $SourcePath -Recurse -File | ForEach-Object {
    $NewFileName = $_.Name -replace ":", "_" -replace ">", ")" -replace "<", "("
	
    $RelativePath = Split-Path -Path $_.FullName -Parent | ForEach-Object { $_.Substring($SourcePath.Length) }
    $DestinationFileFolder = Join-Path -Path "E:\2025Backup" -ChildPath $RelativePath
	
    if (!(Test-Path -Path $DestinationFileFolder)) {
        New-Item -Path $DestinationFileFolder -ItemType Directory -Force
    }
	
    Copy-Item -Path $_.FullName -Destination (Join-Path -Path $DestinationFileFolder -ChildPath $NewFileName) -Force
}

Write-Host "Batch copy and rename complete."

This Powershell script will copy files and folder from any linux OS with any file system to any windows PC with any files system, while retaining the existing directory structure in the process. All you need to do is have the Linux system's drive location shared and accessible on the network and hotname lookup available on your LAN. Simply change the source path in the script to your own source drive/folder location and system name, as well as change the backup path's in the script to where you want to copy the files to.

I then set this script to run daily at midnight to automatically copy the files over every 24 hours when none of the files are going to be in use, so that way the Backblaze cloud backup and work and backing the up to the cloud on its own.