Bug 152009 - Any (imap) filters break Gmail IMAP mail that does *not* trigger the filter.
Summary: Any (imap) filters break Gmail IMAP mail that does *not* trigger the filter.
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail
Classification: Applications
Component: filtering (show other bugs)
Version: 1.9.10
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2007-11-08 11:29 UTC by Gabriel J. Wilkins
Modified: 2009-04-07 19:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel J. Wilkins 2007-11-08 11:29:03 UTC
Version:           1.9.6 (enterprise 0.20070907.709405) (using KDE KDE 3.5.8)
Installed from:    Ubuntu Packages
OS:                Linux

no plugins, no traces, no dumps.
problem:
kmail moves messages out of the imap inbox without being asked to.
requires:
gmail imap enabled account, kmail
background:
now, gmail imap is a little.. quirky, but thunderbird and outlook 2007 both handle this fine, so it at least isn't exclusively a gmail problem, and more likely is just a kmail problem.
gmail provides a folder "inbox", and a folder "[Gmail]/All Mail".
Basically, as I understand it, most operations fail on the All Mail folder, as that's gmail's permanent archive. (without that, this would actually be a pretty serious data loss bug.)
All new messages are to be routed to inbox (barring other gmail-side filters, of which i have none, and this scenario requires none.)

how to reproduce:
use a gmail account.  make sure it's imap enabled through their web preferences panel.
configure kmail to check the account.
send a message to the account.  
shows up in inbox. also shows up in all mail. (this is expected behavior.)
now, create a filter.
i've tried From filters, and Subject filters, both cause this.
I have not tested the action being anything except "move message", but i have tried it with move message being to another folder on the same imap account, a folder on a different imap account, and a local folder.
It is important to note that this bug is seen when the filter rule is *not* triggered.
So, having created a valid filter, send this account another message.
The message momentarily shows up in the inbox and all mail folders, and then disappears from the inbox folder.  (this is the totally incorrect behavior).
Reproduced with 2 different gmail accounts, on 2 different PCs (unfortunately both same version of kubuntu/kde/kontact/kmail).

Other things to note:  exact same scenario tested with outlook 2007 and thunderbird 2.0.foo, and does not happen.  The mail continues to show up in the inbox and all mail folders.
Also, if filter is triggered, the mail is moved properly.  In that scenario, it shows up where ever you wanted it sent to, as well as in the all mail folder.
Also, perhaps obviously, but the bug does not occur when you change the filter (advanced tab) to not be applied to the gmail imap account.  (only checked accounts, uncheck the gmail account.)
Comment 1 Gabriel J. Wilkins 2007-11-08 11:37:04 UTC
to clarify, this is not just a display issue.
once kmail does whatever it does, the message is actually moved, and will be reported as such by all other clients, and the web interface.

discovered while leaving kontact open at home all day, being continually surprised by people saying they had emailed me, yet i had nothing new in my inbox. :(
Comment 2 Mirko Weihrauch 2008-01-21 22:21:35 UTC
At me every new Email is deleted too from the INBOX, if kmail read the email first, if you read the email first with the webinterface or thunderbird with IMAP connection, the email will not removed.

But there is an other interesting thing: If you delete all data from your gmail account in ~/.kde/share/apps/kmail/imap if kmail is closed, and then you login again, kmail count one email less in the INBOX. everytime you repeat it, kmail count one email less.

And, if you have choose the setting in the account configuration: attachments load if request (in german: "Anhänge auf Anforderung laden"), you see not the full number of attachments in emails with attachments. 
e.g: I have an email with 5 attachments, but kmail only show 3 attachments!!
If I choose not the "attachments load if request" option, I see all 5 attachments.

Sorry for my bad english. 

My system: 
KDE Version  1.9.6 (enterprise 0.20070907.709405) (KDE 3.5.8, Kubuntu (gutsy) 4:3.5.8-0ubuntu3.1)
Operating System  Linux (x86_64) release 2.6.22-14-generic
Compiler  Target: x86_64-linux-gnu
Comment 3 Soren Harward 2008-06-16 15:46:07 UTC
Using kmail 1.9.9 w/ KDE 3.5.9 on Gentoo.

Additionally, even if I add a catch-all rule which specifies that any matching message should be moved into the Gmail/inbox IMAP folder, the message still won't get moved there.  The filter log says that it's being moved, but it never ends up there.  Having the filter move the message into any other folder works fine, as does manually moving messages into Gmail/inbox.  But for whatever reason, the filter fails to move messages into Gmail/inbox, even when it says that it is.
Comment 4 Ruchir Brahmbhatt 2009-04-06 19:08:16 UTC
(In reply to comment #2)
> At me every new Email is deleted too from the INBOX, if kmail read the email
> first, if you read the email first with the webinterface or thunderbird with
> IMAP connection, the email will not removed.
> 
> But there is an other interesting thing: If you delete all data from your gmail
> account in ~/.kde/share/apps/kmail/imap if kmail is closed, and then you login
> again, kmail count one email less in the INBOX. everytime you repeat it, kmail
> count one email less.
> 
> And, if you have choose the setting in the account configuration: attachments
> load if request (in german: "Anhänge auf Anforderung laden"), you see not the
> full number of attachments in emails with attachments. 
> e.g: I have an email with 5 attachments, but kmail only show 3 attachments!!
> If I choose not the "attachments load if request" option, I see all 5
> attachments.
> 
> Sorry for my bad english. 
> 
> My system: 
> KDE Version  1.9.6 (enterprise 0.20070907.709405) (KDE 3.5.8, Kubuntu (gutsy)
> 4:3.5.8-0ubuntu3.1)
> Operating System  Linux (x86_64) release 2.6.22-14-generic
> Compiler  Target: x86_64-linux-gnu

This bug is related to gmail imap and kmail filters. Bug related to email count and attachment should be filed separately. Can you please do so if you can still reproduce it?
Comment 5 Ruchir Brahmbhatt 2009-04-06 20:04:21 UTC
I can reproduce on kmail 1.9.10 but not on 1.11.2.
Comment 6 Ruchir Brahmbhatt 2009-04-07 19:11:19 UTC
I'm closing this bug for now. Please feel free to reopen if you can produce on kmail >= 1.11.2.