
Matching same filter for two emails in a row fails on second use.
I have filters set up to file emails to a second IMAP server email account. The filters are set up to copy then delete the email as the source is Gmail. When I get two emails in a row that match the same filter, the first email copies and then deletes as the filter specifies. The second email does not copy but does delete. The filter logs show that both copy and then delete.
Tất cả các câu trả lời (12)
It may help to post a screenshot of the filter.
Log of the two emails being processed, second one dos not show up in email folder. Rules are copy to folder, then delete: (** to obfuscate)
[4/11/2025, 8:00:41 AM] Applied filter "P**NAS" to message from P**NAS - Synology Surveillance Station <c**5@gmail.com> - P**NAS - Surveillance Camera Garage has started archive rotation at 4/11/2025, 8:00:23 AM copied message id = CAG3nodo**Gp6Q@mail.gmail.com to imap://C**e@p**5.synology.me/INBOX/P**NAS
[4/11/2025, 8:00:41 AM] Applied filter "P**NAS" to message from P**NAS - Synology Surveillance Station <c**5@gmail.com> - P**NAS - Surveillance Camera Garage has started archive rotation at 4/11/2025, 8:00:23 AM deleted
[4/11/2025, 8:00:41 AM] Applied filter "P**NAS" to message from P**NAS - Synology Surveillance Station <c**5@gmail.com> - P**NAS - Surveillance Camera Front has started archive rotation at 4/11/2025, 8:00:23 AM copied message id = CAG3nodo**F2ug@mail.gmail.com to imap://C**e@pl**5.synology.me/INBOX/P**NAS
[4/11/2025, 8:00:41 AM] Applied filter "P**NAS" to message from P**NAS - Synology Surveillance Station <c**5@gmail.com> - P**NAS - Surveillance Camera Front has started archive rotation at 4/11/2025, 8:00:23 AM deleted
We need to see the filter rules in a screenshot.
Filter Rule:
Thanks for posting that.
You said that you have filters (plural) and that two messages "match the same filter". Does more than one filter run?
Checking some more.... In the log, it shows all all actions (copy, delete, stop execution) applied to each email. The activity manager shows both messages deleted, but only one copied. This is what I am seeing as happening, but is not what the message filter log shows.
I reproduced this problem (assuming that it is a problem and that I am not missing a reason why the filter should operate this way).
I do not know why this problem happens or how to fix it at its root.
The filter will do what you want if you move the messages instead of copying and deleting them.
Thanks Scooter. I wrote it up because I didn't understand why it was happening.
I was doing the move and delete because the source is Gmail. It does not work the same as a 'normal' Imap server. All mail is in All Mail, and flagged as to what folder it is in. Move removed the flag, so it is still in All Mail. Copy doesn't remove the folder flag. Delete marks it and starts a timer to actually delete it. Move and then delete might have worked, but you cannot put a delete action after a move action using the filters. Copy and then delete seems to work in all instances except for when the same filter is activated for tow emails in a row.
Some people on the forum recommend not subscribing to All Mail in Thunderbird. I know little because I do not use gmail. I wonder if you can run this filter on an inbox instead.
The filter is running on an inbox. I was planning to not have All Mail after I was sure things were working correctly.
Change filter execution to after junk classification and see if that helps. I am guessing you are seeing a race condition, perhaps exacerbated by the use of an antivirus in the profile folder which delays file updates as the thing scans the first update and then the second silently fails.
So I would recommend a general exception in any antivirus product or streaming backup solution for the entire Thunderbird profile. Most issues with IMAP copying come down to timing and the frequency of the updates. In this case having the filter execution just a little later (after classification) might assist in the timing, examining things that might be slowing the actual copy is also relevant. That includes the upload of the message top the new mail server which will occur as a part of the copy. It might be you have a slug installed doing antivirus duty that is causing things to fail as it fiddles around.
Try copying the message to a local folder instead of the IMAP account and see if that makes things work. It might help in identifying where the failure occurs. Also look to the error console (Ctrl+Shift+J) for errors and timeouts for the time the filter is supposed to be misfiring.
Changing to after junk classification definitely made a difference. Both emails get copied to the different IMAP server, and both are now in the Trash of Gmail. Then the weird part comes in. If I open the Gmail trash folder, both emails get copied to the other IMAP server again and then they are fully deleted from Gmail. The filter seems to run again, this time on the Gmail Trash folder.