Closed Bug 847831 Opened 12 years ago Closed 2 years ago

Filters with custom headers don't run when another filter searching mail body exists (only when fetching mail)

Categories

(Thunderbird :: Filters, defect)

17 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 622307

People

(Reporter: mejlaandersj, Unassigned)

References

(Depends on 2 open bugs)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0 Build ID: 20130227155931 Steps to reproduce: I have several filters for adding tags to email based on the custom header "List-Id". One of these filters use a message body search, for putting the right label on mail sent from a website which does not provide a suitable identifying header. In an alternative setup (on another computer) I have a filter for extracting all attachments using the extension FiltaQuilla's "detach"-action. Here the message body search condition is not used. Then I fetch mail which should get filtered. IMAP, everything synchronised (standard setting). Actual results: The conditions using the custom header (List-Id) does not seem to be fulfilled when I also have one of the "body searching" conditions or actions activated. Thus mail which should be tagged are not. Expected results: The "List-Id"-conditions should be fulfilled and the messages tagged, even when the messages body are also accessed by a condition or an action. It works when using a standard header like "From" combined with one of the message body functions. But not with the custom headers. The current setups also work as expected when running the filters manually on a folder.
related to Bug 622307 ?
Flags: needinfo?(mejlaandersj)
(In reply to Wayne Mery (:wsmwk) from comment #1) > related to Bug 622307 ? aceman, mejlaandersj seems to be gone. What do you think about dup?
Flags: needinfo?(mejlaandersj) → needinfo?(acelists)
I don't think we have enough information to judge that. If the reporter is away, I'd close this Incomplete.
Flags: needinfo?(acelists)
If Body is used as condition, or if action requires message body, filter application is executed after download of entire mail data. > http://mxr.mozilla.org/comm-central/source/mailnews/imap/src/nsImapMailFolder.cpp#668 > 668 // If a body filter is enabled for an offline folder, delay the filter > 669 // application until after message has been downloaded. See Bug 971401 and Bug 1067706 for it, and IMAP log attached to these bugs, "uid xx:yy ( ... FETCH.BODY.PEEK[])" is issued first. upon "Normal Message End Download Stream" of ech UID, message filter for the UID is invoked. See also code where m_filterListRequiresBody is referred. > http://mxr.mozilla.org/comm-central/search?string=m_filterListRequiresBody&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=comm-central This may cause following upon "filter when new mail fetch".. If m_filterListRequiresBody==flase, not in "delay" mode, so message header is unfolded. If m_filterListRequiresBody==true, in "delay" mode, so message header is not unfolded(as-is). This may be similar to difference between "filter upon new mall download" and "manual filter run" in POP3. To bug opener : problem on any term in any folded line of any custom header? or problem on terms in non-first folded header lines?
As seen in test for Bug 1067706, duplication test is pretty simple and easy. Merely add a folded custom header lines in test mails. Merely add a filter condition for the custom header. Wayne and :aceman, I'll try to test. If folded/unfolded is relevant to problem, and if "custom header data in msgDBHdr" is used first, mailnews.customDBHeaders = "custom_header_name" can be a solution of this kind of problem.
(In reply to Wayne Mery (:wsmwk) from comment #1) > related to Bug 622307 ? As :aceman reported by bug 622307 comment #8, > - Invoking "Run Filters on Message" on the message that should be filtered DOES NOT work. (this is the original report). > - Invoking "Run Filters on Folder" DOES work. > - Opening "Message Filters..." selecting the filter with custom headers and clicking "Run now" DOES NOT work. there are several kinds of "message filter application". ApplyAfterTheFactFilter type : "Run Filters on Folder". batch type Filter target = all mails in a mail folder => "header data of entire mail data" is always available if local mail folder ApplyMessageFilterOn(Selected)Messages type : "Run Filters on Message", "Run now". "Filter upon new mail fetch" is perhaps categorized to this. Filter target = list of msgDBHdr => available data is "header data held in msgDBHdr". If "apply selected filter rules" type, "temporary message filter" is generated internally. In any case, "where message header is held" and "header lines are unfolded or not" depends on options and conditions. At server only(folded), in local store file(folded), in buffor for header parsing(unfolded), in msgDBHdr(unfolded) If IMAP, "where entire mail data is held" depends on options and conditions. At server only, in network buffer by "uid fetch xx:yy BODY.PEEK[]", Offline-Store file by auto-sync If bug summary of this bug is correct, I believe that Bug 622307 is surely relevant to this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Depends on: 622307, 184490
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.