Open Bug 522690 Opened 15 years ago Updated 2 years ago

Filter with "Mark as read" marks mail as read, but "new mail system tray icon" still appears (IMAP?)

Categories

(Thunderbird :: Folder and Message Lists, defect)

x86
Windows Server 2003
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: Sebastian.Leske, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2b2pre) Gecko/20091015 Namoroka/3.6b2pre (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.5pre) Gecko/20091015 Shredder/3.0pre

I use a filter to mark some messages as read and put them into their own folder.

This works, except for the fact that the "new mail" indicator (icon in the task bar) still appears whenever I receive mail that is handled by the filter.

If I hover over the new mail taskbar icon, it shows a nonsensical number of new messages (e.g. 162 new messages, even though I only received one new message). At the same time, the folder list correctly shows the filtered new message as read (no "unread messages" indication on the target folder). Only the new mail indicator is wrong.

As soon as I click on "Get Mail", the new message indicator clears, even if no new mail is received.

The folders involved are all IMAP folders on an Exchange mail server.

Reproducible: Always

Steps to Reproduce:
1.Get an IMAP account
2.Create a subfolder "filtered"
3.Create a rule that 1)marks mail as read, 2) puts it into "filtered"
4.Send mail that matches the rule
Actual Results:  
"new mail" notification pops up, with a nonsensical number of unread messages in its popup. The mail correctly gets moved into folder "filtered", and in the folder view folder "filtered" shows no new messages.

Clicking "get mail", or selecting the new mail in "filtered" clears the new mail indicator.

Expected Results:  
New mail indicator should not appear for messages marked as read by a filter.

Interestingly, a filter that *only* uses "mark as read" does not cause the new mail indicator to appear.

This is rather annoying, as one common use of filters is to file some mails away as "less important": mark as read, put into a folder for later reading and deleting. This bugs makes the new mail indicator useless in this setup, as it always appears.

Might be related to:

#261201 -  inconsistent unread message count display

#496254 -  New mail alert says "N new mails" even if all downloaded N mails is moved to local Junk folder by "Junk filtering for message-filter-moved mails" (POP3)  

#460496 -  'move to folder' + 'mark as read' filter fails to mark as read
Oops, links not working, so bug list again:

Might be related to:

bug 261201 -  inconsistent unread message count display

bug 496254 -  New mail alert says "N new mails" even if all downloaded N mails is
moved to local Junk folder by "Junk filtering for message-filter-moved mails"
(POP3)  

bug 460496 -  'move to folder' + 'mark as read' filter fails to mark as read
I tested this (using recent trunk) and I could not reproduce it. That is, the new mail popup did not occur when the message was marked as read prior to being moved.

Perhaps this is an Exchange server only thing?
@Kent(In reply to comment #2)
> I tested this (using recent trunk) and I could not reproduce it. That is, the
> new mail popup did not occur when the message was marked as read prior to being
> moved.
> 
> Perhaps this is an Exchange server only thing?

Just to avoid a misunderstanding: What do you mean by "new mail popup"?

This bug is not at all about the "new mail popup" that slides up from the taskbar and shows message subject etc. (the one that can be (dis)abled from the Options dialog under "General / When new messages arrive / Show alert"). This is about the tray icon that appears when new mail arrives (this tray icon can apparently only be disabled via about:config, not in the options).

At any rate, I can confirm that the "new mail popup"/"alert" is not affected by this bug. I'll change the summary to make the distinction clear.
Summary: Filter with "Mark as read" marks mail as read, but new mail indicator still appears (IMAP?) → Filter with "Mark as read" marks mail as read, but "new mail system tray icon" still appears (IMAP?)
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Sorry, I totally fail to see why this is a duplicate of 378582. 378582 is about the new mail alert not appearing when it should. This bug is about the systray new mail icon appearing when it should *not*. They may well be related of course, but they describe opposite problems.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
This one's bugging me for a while now, it's interesting that it's that old...

I'm using dovecot IMAP, so it's not related to an exchange server.

I'd say that the new mail sys-tray icon, new mail alert sound and highlighted e-mail account text (I think those overlay notifications didn't appear as stated in an older comment) should be processed AFTER the filters have been run.

Not sure about the overlay but it seems to be processed after the filters, otherwise it would appear there too.

I think that this shouldn't be too hard to fix and I would really welcome it to see it fixed in the upcoming version.
(In reply to Nico Hamm from comment #6)
> 
> I think that this shouldn't be too hard to fix and I would really welcome it
> to see it fixed in the upcoming version.

The problem with these is that, in fact, they are typically quite difficult to fix. I fixed a few such issues a few years ago, and the root problem is that there are multiple internal definitions of "new mail", often overloaded to use for other purposes. That makes it very difficult to fix an issue without causing a regression in some other area that you don't expect. Some of these issues are discussed in Bug 441932.
After updating to v12 the icon appears in task bar as there are unreaded emails but the emails are in folders marked as readed by the filter.

In left menu, the name of the account turns to blue and only back to black when the last email is readed!

This happens with a pop/smtp account

I hope you reopen this issue. 

Thank you
Over 4 years after being filed, this still isn't fixed. This bug has annoyed me for years, and I just can't take it anymore. If this isn't fixed soon, I'm switching mail clients (after 10+ years of Thunderbird).

Like Nico Hamm, I'm using Dovecot with IMAP on the server-side. I doubt that it's relevant; I mention it only to exclude the possibility that this problem is related to Exchange.

I would describe the problem exactly as Sebastian Leske did in his initial report. The version of Windows, the version of Thunderbird, etc. don't seem to matter, as I'm on Windows 7 x64 with Thunderbird 24.3.0 and the problem is exactly as described.

I'll just be working away and see the "new mail" icon appear in the Windows system tray. (Again, to be clear, this is the small icon, roughly square in dimension, that appears in the so-called system tray, just to the left of the clock, in the bottom, right-hand corner of the screen.) Naturally, I switch over to the Thunderbird application to see what mail has arrived, and there's no new mail.

Also, I can confirm the original reporter's comment regarding a ridiculous number of new messages reported when mousing-over the new mail icon in the system tray. (I don't know whether Thunderbird grossly overreports the number of new messages all the time, or only in this scenario.) For example, right now, the tool-tip that appears when I hover over the icon reads, "user@domain.com has 408 new messages". I have NO new messages, and certainly not 408. I just clicked-through every single folder under that account and see "Unread: 0" at the bottom right of the Thunderbird interface. From whence does this 408 value come??? For whatever it's worth, I have double-checked my IMAP subscriptions for this account and I am subscribed to every single folder.

I have noticed what may be a subtle clue: when this error condition occurs, the "Account Name" in Thunderbird's left-hand pane is blue. Normally, the Account Name is black; it turns blue only when there is new mail for the account. So, in other words, despite the fact that I have no new mail, the Account Name turns blue, just like it does when I do, in fact, have new mail.

I can provide what may be another useful clue. The original reporter mentioned that he has several local filters enabled that move mail and mark it as read upon arrival. I have NO local filters, but I DO have server-side Sieve filters. In particular, I have a Junk Mail filter that looks like this:

# Move spam to spam folder
if header :contains "X-Spam-Flag" "YES" {
  fileinto "Junk";
  # Stop here so that we do not reply on spams
  stop;
}

At this time, and in my particular case, my working theory is that this error condition occurs when a new message is marked as read and moved to the Junk folder via the server-side Sieve rule.

Finally, as others have stated, clicking any folder beneath the account (it doesn't seem to matter whether it's the Inbox, a sub-folder thereof, or any other folder at the top-level of the IMAP account) causes the new mail tray icon to disappear and the Account Name to switch from blue to black.

I'm happy to answer any questions with regard to my setup of the observed behavior.
A follow-up to my previous remark: I can confirm that this occurs when my server-side IMAP filter (Sieve, which is running under Dovecot) moves a spam message to my "Junk" folder upon arrival. A slight correction to the Sieve script that is doing the actual filtering server-side (I had omitted the "seen" flag):

##########################

require ["fileinto", "regex", "date", "relational", "vacation", "envelope", "imap4flags"];

# Move spam to spam folder
if header :contains "X-Spam-Flag" "YES" {
  addflag "\\Seen";
  fileinto "Junk";
  # Stop here so that we do not reply on spams
  stop;
}

##########################

Can we set the status to CONFIRMED yet?
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.