messages could not be filtered to folder X because addi

User Help for Mozilla Thunderbird
johnc123
Posts: 12
Joined: September 17th, 2015, 5:51 pm

Re: messages could not be filtered to folder X because addi

Post by johnc123 »

JJanusz wrote:Hi,
this is still very fresh, but I think it has started to work! Thank you for your help! Firstly I changed manually the setting for some filters. But changing all 150+ filters would by too tedious. Fortunately I found a solution to that problem. Instead of using the user interface I've changed the configuration file. Here are the steps:
0) Closed Thunderbird (it is never a good idea to change configuration while a program is working :) ).
1) Found the msgFilterRules.dat file (its location is system dependent, good first try is c:\Documents and Settings\<your account id>\Application Data\Thunderbird\Profiles\<something looking like rubbish>.default\Mail\<your mail server>\
2) Made a copy of that file (just in case).
3) Opened it in a text editor (like notepad). Looked at "type" lines. Most have the following form:
type="17"
Some - where I change filtering form before to after junk classification - were like this
type="48"
4) Changed all "17" into "48". Saved the file.
5) Started Thunderbird again. All filter settings were changed to after junk classification!

I hope it will work in the future, as it seems now.

Thank you once more for your before/after advice!
ps I don't know if anyone else is getting this but I still get messages occasionally being moved into a folder by a filter (as they should be) and marked as unread but the folder is not visually marked as having new messages. This seemed to be part of the above problem since it appeared at the same time but perhaps it isn't if no one else is reporting it.
spikowski
Posts: 1
Joined: March 24th, 2016, 5:24 am

Re: messages could not be filtered to folder X because addi

Post by spikowski »

Hi,
this is still very fresh, but I think it has started to work! Thank you for your help! Firstly I changed manually the setting for some filters. But changing all 150+ filters would by too tedious. Fortunately I found a solution to that problem. Instead of using the user interface I've changed the configuration file. Here are the steps:
0) Closed Thunderbird (it is never a good idea to change configuration while a program is working :) ).
1) Found the msgFilterRules.dat file (its location is system dependent, good first try is c:\Documents and Settings\<your account id>\Application Data\Thunderbird\Profiles\<something looking like rubbish>.default\Mail\<your mail server>\
2) Made a copy of that file (just in case).
3) Opened it in a text editor (like notepad). Looked at "type" lines. Most have the following form:
type="17"
Some - where I change filtering form before to after junk classification - were like this
type="48"
4) Changed all "17" into "48". Saved the file.
5) Started Thunderbird again. All filter settings were changed to after junk classification!
I've been having the same problem with email filters in Seamonkey, intermittently but especially bad recently. I followed this advice, using Wordpad's "find and replace" -- it seems to have completely solved my problem -- thanks for coming back here and posting your solution!
martinr
Posts: 23
Joined: April 19th, 2016, 7:14 am

Re: messages could not be filtered to folder X because addi

Post by martinr »

What you could also try before going through this elaborate scheme is:
1. compact the folder that the message has to be filtered to
If that doesn't work
2. rebuild the index of that folder (right click the folder -> properties -> General information (tab) -> Repair Folder (button)

I also get an Error at start-up of Thunderbird when it automatically starts filtering incoming new messages to IMAP subscribed folders.

The Filter log entry of the failure is:
"Filter Action Failed: "Move failed" with error code=0x8055000f"

When I manually run the filters on the in-box folder, then it works fine.

Also have a look at: Bugzilla
johnc123
Posts: 12
Joined: September 17th, 2015, 5:51 pm

Re: messages could not be filtered to folder X because addi

Post by johnc123 »

@martinr

That is precisely what happens with me. I believe there is some sort of race condition or similar contention so that the folder is locked when it tries to access it and then by the time you get there to run the filter manually the problem no longer persists - this also seems to be what the bug report you linked to is saying. Rebuilding the index does not do away with the problem (not for me at least) it will recur the next day or week or....
coverturtle
New Member
Posts: 1
Joined: September 26th, 2012, 5:14 am

Re: messages could not be filtered to folder X because addi

Post by coverturtle »

I have the same problem and I have been putting up with it for over a year because nothing I do seems to help so I just run a manual check. I have tried changing the before or after check for junk mail but I haven't changed it for all the filters at once. It does indeed seem to be a race problem but it seems that would occur randomly and it does not account for the fact that the failures occur for only certain files/folders. With respect to that, I have tried rewriting the filter, changing the the way I name folders (some large folders had extra special characters to make them more visible), and probably without exception, every one of the above suggestions except changing ALL the "17"s to "48"s. I did notice that the failures seem to occur with mail filters which have a high volume. Rather than calling this a race condition, I think this could be a collision phenomenon in which more than 1 or 2 or "n" messages to be sorted by the same filter will try to access the same file at the same time. This could explain the failures for the automatic filter system and explain why the manual filtering does work. Most likely, the automatic filtering is triggered by each arrival of a message when they are read from the account. Each new message spawns a process dedicated to that particular message without (enough) respect for what the other spawns are doing, i.e. there is no interaction. Two messages from the same account to be sorted by the same filter will try to access the same file at the same time. Respect (by the system) demands that the file's integrity be maintained and that no data be lost will give the results we see. One of the reasons this can happen is because the account may not be queried for new mail for some time but when it is there are many emails to download, so more frequent account access might help but will not solve the problem conclusively.

Assuming that what I have described is the problem, it must be solved at the programming level and two different solutions can be presented. (OK, there may be others.) Basically, no sorting should be done until the accounts are already downloaded and then the same algorithm used in the manual filtering can be used. The other solution is to have a queue for each filter and one process spawned for each filter. The former will see the emails show up in the local folders temporarily and the latter will be able to dispatch the emails to the filter targets more quickly, possibly without showing up in the local folders. It may be that changing the "17"s to "48"s automatically employs the first method. But the way it does NOT work now is a BUG. For someone familiar with the code already in place, it seems it would not be too lengthy a fix.

My system is Fedora Release 25. This problem was present in the last 3 releases so it does not seem to be system related.
kelendral
Posts: 17
Joined: March 28th, 2009, 11:11 pm

Re: messages could not be filtered to folder X because addi

Post by kelendral »

I'm here from 2022 to say this issue is worse than ever on Thunderbird 91.5.0!

2 Major bugs both more than almost 7 years old.
Bug 1: The random filter failures when filtering is set to occur before Junk Classification
Bug 2: If filtering occurs after Junk Classification, then moved messages don't mark folder as having new messages.

Either bug fixed in the past 7 years would been helpful helpful to mitigate these major breakages, but both have been ignored.
7 years of broken filtering and counting at least.
kelendral
Posts: 17
Joined: March 28th, 2009, 11:11 pm

Re: messages could not be filtered to folder X because addi

Post by kelendral »

Here I am in Oct 2022 on Thunderbird 102.3.3. I haven't had this issue for a while, but then I recently took a look in my Junk folder and I see why.

As of the latest versions of Thunderbird, even though my filters are set to run BEFORE junk classification, they do not appear to be running until after.
As an example: I have the following filter rule:
MANUALLY RUN: CHECKED
GETTING NEW MAIL: FILTER BEFORE JUNK CLASSIFICATION
MATCH ANY OF THE FOLLOWING:
FROM - CONTAINS - @UNITY3D.COM
FROM - CONTAINS - .UNITY3D.COM

However, after recently redeeming some keys for a humblebundle order I find all the confirmations that I redeemed those keys in the JUNK folder.
The emails have a FROM address of "accounts@unity3d.com".

So it seems that Thunderbird has worked around the issue by doing what people do not want and always filtering AFTER junk classification regardless of the settings.
Post Reply