Bug 355063 - New mail notification shown for newly-fetched \SEEN emails
Summary: New mail notification shown for newly-fetched \SEEN emails
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: misc (show other bugs)
Version: 5.1
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-09 00:20 UTC by Iain Nicol
Modified: 2017-11-26 15:21 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.7.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Iain Nicol 2015-11-09 00:20:51 UTC
The new message notification popup is shown for emails which kmail has never seen before, regardless of whether you have previously read the message in a different mail client.

Reproducible: Always

Steps to Reproduce:
1. You need an IMAP account set up in kmail.  Make sure it's configured to not fetch messages when kmail is closed..
2. Quit kmail.
3. From a different application (possibly webmail), send your kmail account a message.  Send it from a different account, because new message notifications may be configured to ignore emails sent by yourself.
4. Read that new email in your inbox, again using a different application.  This in effect sets the IMAP \SEEN flag.
5. Open kmail and fetch messages.

Actual Results:  
The new email is correctly added to the folder's message list and shown there as unread (i.e. black text, not blue text).  Similarly, the folder list's unread email count correctly reflects the email as unread.

The problem is that, once kmail finishes synchronizing the folders, the "New email notify" popup is shown for this \SEEN-but-new-to-kmail email.

Expected Results:  
There should be no such notification.

This happens for me consistently, with both v4.14.10 and v15.08.2.  It happens both for Gmail IMAP and non-Gmail IMAP accounts.

I've tried debugging, but I didn't make huge progress because unfortunately I'm not familiar with how to enable log files or otherwise debugging kdepim-runtime.

I don't think the bug is in newmailnotifieragent.cpp.  Its itemAdded() adds the email to its list of emails to notify about, because the item it is given does not have the \SEEN flag set.  Nor is NewMailNotifierAgent::itemsFlagsChanged() ever called, so the agent has no reason to remove the email from its list of emails to notify about.
Comment 1 Malte S. Stretz 2016-04-07 13:00:43 UTC
Still happens in KMail 5.0.2.

Since I mostly use KMail as an oversized biff and mainly use the webmailer it is a bit irritating if get a desktop notification when I just move a read mail back to the Inbox as part of my Inbox Zeroish mail workflow.