為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Which of multiple headers in a message does a Thunderbird filter property check?

  • 5 回覆
  • 1 有這個問題
  • 14 次檢視
  • 最近回覆由 Matt

more options

I am making filters which have a property based on a `X-Original-To`, a header of the email message. It is straightforward to create a Thunderbird message filter on the value of this header (e.g. take action when `X-Original-To` header begins with 'list+'). However, the behaviour of the filter is confusing when the message has multiple `X-Original-To` headers. I can't find anything which tells whether Thunderbird applies the filter to the first matching header, or to the last, or any arbitrary-chosen matching header, or what.

The `X-Original-To` header is not built in to the Thunderbird UI, but I think that is not material. Most email messages I have seen have multiple `Received` headers. How does a Thunderbird message filter property testing the `Received` header behave?

I expect there to be documentation stating what correct behaviour of a Thunderbird filter is. I cannot find such documentation. In fact the only documentation on filters I have found is "Organize Your Messages by Using Filters" (https://support.mozilla.org/en-US/kb/organize-your-messages-using-filters). Is there documentation I am missing?

From observation, I suspect that Thunderbird applies the filter property only to the final occurrence of a header in a message, and ignores any previous occurrences of that header in that message. The insight here is, if a filter property on a message header just _is not_ behaving as expected, check if your message has multiple occurrence of that header, and if you are seeing only the first one. Maybe the filter property is in fact operating as expected, but on the final occurrence.

Is there any Thunderbird UI to control which of multiple occurrences a filter property checks? Is there a way to make it check the first occurrence, instead of the last?

When my filter misbehaves, I do not see an entry in the Filter Log describing how that fllter tested against that message. The Filter Log only seems to get messages when a filter property matches against a message. This is unhelpful when diagnosing a problem of a filter _not_ matching. I expect log entries for failed matches also, though I recognise that would get very verbose very quickly. A message when a filter finds multiple occurrences of a header it is testing would be very helpful. Is there a way to make the Filter Log describe failed matches?

My primary questions are, which of multiple headers in a message does a Thunderbird filter property check? Where should a Thunderbird user discover this answer when setting up their filters?

I am making filters which have a property based on a `X-Original-To`, a header of the email message. It is straightforward to create a Thunderbird message filter on the value of this header (e.g. take action when `X-Original-To` header begins with 'list+'). However, the behaviour of the filter is confusing when the message has multiple `X-Original-To` headers. I can't find anything which tells whether Thunderbird applies the filter to the first matching header, or to the last, or any arbitrary-chosen matching header, or what. The `X-Original-To` header is not built in to the Thunderbird UI, but I think that is not material. Most email messages I have seen have multiple `Received` headers. How does a Thunderbird message filter property testing the `Received` header behave? I expect there to be documentation stating what correct behaviour of a Thunderbird filter is. I cannot find such documentation. In fact the only documentation on filters I have found is "Organize Your Messages by Using Filters" (https://support.mozilla.org/en-US/kb/organize-your-messages-using-filters). Is there documentation I am missing? From observation, I suspect that Thunderbird applies the filter property only to the final occurrence of a header in a message, and ignores any previous occurrences of that header in that message. The insight here is, if a filter property on a message header just _is not_ behaving as expected, check if your message has multiple occurrence of that header, and if you are seeing only the first one. Maybe the filter property is in fact operating as expected, but on the final occurrence. Is there any Thunderbird UI to control which of multiple occurrences a filter property checks? Is there a way to make it check the first occurrence, instead of the last? When my filter misbehaves, I do not see an entry in the Filter Log describing how that fllter tested against that message. The Filter Log only seems to get messages when a filter property matches against a message. This is unhelpful when diagnosing a problem of a filter _not_ matching. I expect log entries for failed matches also, though I recognise that would get very verbose very quickly. A message when a filter finds multiple occurrences of a header it is testing would be very helpful. Is there a way to make the Filter Log describe failed matches? My primary questions are, which of multiple headers in a message does a Thunderbird filter property check? Where should a Thunderbird user discover this answer when setting up their filters?

所有回覆 (5)

more options

Filters act on the first instance they encounter has been my observation. So reading from the tops. the first you come to will be the one used.

more options

@Matt, thank you for your observation. My observation, at least with checking for the `X-Original-To` header, is opposite. Thus we have conflicting observations, and a greater need for a clearer statement of which header Thunderbird is supposed to check in filter properties.

more options
more options

Thank you for the tip! I had a quick read through nsMsgSearchTerm.cpp, and I couldn't find an answer to the question of which of multiple headers does Thunderbird read. Seeing the answer probably requires being more familiar with the codebase overall. The answer might lie in a different module, for instance in the implementation of nsIMsgDBHdr::get().

more options

You are probably correct, I get out of my depth fairly quickly with the style of C++ used in Thunderbird.