Filters are applied to autosaved draft emails



7 years ago
2 years ago


(Reporter: heapifyman, Unassigned)


Windows 7

Firefox Tracking Flags

(Not tracked)




7 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.854.0 Safari/535.2

Steps to reproduce:

I have an IMAP account with several folders. Also I have for almost each of these folders a filter that moves incoming mail to the folders depending on e.g. whether the subject contains a certain term. I also set the preference to store answers to an email in the email's folder.
When I reply to an email in one of those imap folder for which I have a filter, the following happens

Actual results:

When the autosave functionality for the draft email reply kicks in, it stores the draft in the "Drafts" folder. Then my filter is apparently applied to the draft email in the Drafts folder and the draft is stored in my IMAP folder - I see a log event like "Moved 1 email from Drafts to <FOLDER>. This happens for each of the autosaved drafts. If composing the reply email takes some time, my IMAP folder is cluttered with draft replies, which are also not automatically deleted after I send the reply mail.
This also happens in save mode with all extensions disabled.
Deleting and re-implementing all filters also did not change anything in the behaviour described above.

Expected results:

Filters should not be applied to the Drafts folder. Drafts should stay in the Drafts folder and be deleted after the final mail has been sent.


7 years ago
OS: Mac OS X → Windows 7

Comment 1

7 years ago
Steps to reproduce:
- in your IMAP account's settings -> Copies and Folders -> check "Store replies in orginal mail's folder" (not sure if that is the correct English translation - using German version - but you'll understand I guess)

- create IMAP folder "testfolder"

- set view options for that folder to "sort by date descending, group by subject"

- create filter: if subject contains "testfolder" move email to "testfolder" - minimum one condition has to be fulfilled, apply filter at: "Checking messages (after Junk filter) or when manually checking messages" (again not sure about the English translation)

- receive email with "testfolder" in the subject line

- go to folder "testfolder"

- reply to email with "testfolder" in subject line and write something

- wait till autosave kicks in

- check in Tools->Activities log: there should be a message saying something like "Moving 1 message from Drafts to "testfolder"
Component: General → Filters
Product: Thunderbird → MailNews Core
QA Contact: general → filters
Do you have extension installed ?

Comment 3

7 years ago
I do have several extensions installed, among them enigmail and lightning. However, I tried with Thunderbird in Safe Mode and all extensions disabled, which showed the same behaviour (as mentioned in above bug description).
What I haven't tried yet is using a fresh new profile
Ever confirmed: true
Good that you tried safe mode, but what addons do you use?

ALso, are you absolutely sure the draft is saved in Drafts folder?  You should see the Draft folder message count increase.  

If the answer is no, given the steps listed the fault here is not Filters. these dialogs have been known to lie - for example that  Draft got saved to the wrong place along the lines of Bug 257735 - Drafts wrongly saved to sent folder after failing and retrying. However, bug 257735 is fixed and I don't see any matches to open bugs from 

Also, I use those settings and have never seen this problem.

heapifyman, can you attach an imap protocol log of this action please?
 use imap:5

Comment 5

7 years ago
I'm not a hundred percent sure if the draft is saved in the draft folder and then moved to one of my other folders. But actually that is not the real problem.
The problem is that the drafts end up in the other folder and do not get deleted when finally sending the email. Thus, when composing an email takes some time and the email draft is autosaved 5 times I end up with 5 draft emails in my folder, plus the email reply that was really sent.
1. I have received an email with subject "X"
2. I have an IMAP folder named "Y" and a filter that moves incoming emails with subject "X" to folder "Y"
3. I compose a reply to the email in folder "Y"
4. Composing the reply takes some time, the draft is autosaved 5 times
5. I finish and send the reply

Result: folder "Y" now contains the original email, my 5 autosaved draft replies and my actual reply.

I could live with the draft being saved in the folder and not in the "draft" folder, if the drafts would get deleted when finally sending the message.

I'm sorry if the original bug report was not clear and I hope this clarifies things.
heapifyman, comment 5 is already reported as a different bug.

Please try a new profile (keep the old one) and report your results please.  see
Ever confirmed: false

Comment 7

3 years ago
We face the same problem here.
We've got a filter to dispatch incomming mails from our companies (8) in specific folders.
Each time a draft is saved, the filter moves it to the imap folder of the writer's company, instead of leaving it in the draft folder.
If automatic saving is on, and you spend time writing the mail, you may have several copies in the destination folder (one per save).
Hurrican39, do you stil see this problem when using a current version 45?
Or better yet, a current beta from

(The reporter, heapifyman, no longer uses thunderbird.)
Flags: needinfo?(jmgigandet)
See Also: → bug 1197782
Summary: Filters are applied to draft emails → Filters are applied to autosaved draft emails

Comment 9

2 years ago
Just made a try with version 45.4.0 and it seems to be fixed.
Filter is not applied when Autosave is called.
There's only one copy of the saved document in the Drafts folder after multiple autosave.
Last Resolved: 2 years ago
Flags: needinfo?(jmgigandet)
Resolution: --- → WORKSFORME

Comment 11

2 years ago
I'm using TB50 and this thing just happened to me.
I worked around it by adding a "sender is not me" condition to my filter.
I have quickFilters module installed.
You need to log in before you can comment on or make changes to this bug.