Bug 266154 - Bogofilter doesn't work with KMail anymore
Summary: Bogofilter doesn't work with KMail anymore
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: filtering (show other bugs)
Version: 2.0.89
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-12 19:19 UTC by Frank Steinmetzger
Modified: 2017-03-23 19:17 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Steinmetzger 2011-02-12 19:19:39 UTC
Version:           2.0.89 (using KDE 4.6.0) 
OS:                Linux

After migrating to Akonadi-based KDEPIM a few weeks ago ago, I noticed that bogofilter didn't have an effect on my incoming mails anymore. So I deleted the responsible filters and ran the spam filter wizard anew (because other filters didn’t work, too because of changed folder IDs). The resulting filters were the same, and bogofilter still doesn't work -- there is no X-Bogosity header in new mails.

I tested it on the commandline -- I saved a spam mail to a file and fed it to bogofilter -- the mail was correctly recognised as spam. So I suspect that bogofilter is unable to alter the mail header due to the new way of KMail's handling of mail files.

Reproducible: Always

Steps to Reproduce:
Fetch mails with bogofilter set up for spam filtering.

Actual Results:  
New mails don’t get the bogofilter header "X-Bogosity" attached. Thus, KMail doesn’t know whether the mail is spam or ham and can’t act accordingly (move to spam folder, mark as read, etc.)
Comment 1 Ewald Müller 2011-02-19 07:53:06 UTC
I experience the same behaviour, in the unchanged filter-settings (SPAM-Assistant) is a rule, that all mails with size >= 0 (*greater* than zero) are to be classified as spam. 

Is that the mistake ?
Even if i change the filtersettings to 'size *equal* zero' the spam folder gets empty, then is filled again with 'normal' mails

Greetings 

Ewald Müller (mue.de)
Comment 2 Charlie Figura 2011-02-19 18:17:05 UTC
I can corroborate the original post.  I have the kmail filter configured to pipe through /usr/bin/bogofilter -pev -c /home/cfigura/.bogofilter/bogofilter.cf.
As Frank noted, this works perfectly on a SAVED mbox file run from the command line, but does not run as a filter, either automatically or manually.

As a side note, if I precede the 'pipe through' instruction with the typical 'Remove headers X-Attachments' and/or 'Remove headers X-Bogosity', the AkonadiTray pops up one of the following warning notifications: (note, 'Wartburg' is our disconnected IMAP server)

Wartburg: Append failed, server replied: A000174 NO Folder is not found. [ TRYCREATE  ]

Wartburg: Could not determine the UID for the newly created message on the server
Comment 3 S. Burmeister 2011-03-14 18:14:09 UTC
Still an issue with
Comment 4 Matija Šuklje 2011-04-27 14:54:19 UTC
I wonder if this is related to bug #255388
Comment 5 Aldoo 2011-05-12 13:27:43 UTC
I notice the same issue with SpamAssassin.

However I am positive SpamAssassin is actually working in background: importing big folders from my older was slowing down my computer, and I was able to see the SpamAssassin process taking CPU % in the process list.

That is why I believe the issue is actually a problem with modifying the headers. The new Kmail seems unable to do this.
Comment 6 Matija Šuklje 2011-06-02 16:05:18 UTC
(In reply to comment #4)
> I wonder if this is related to bug #255388

To answer my own question:

It seems this is not related to that bug, as that bug was fixed and spam filters still don't work for me.
Comment 7 S. Burmeister 2011-06-02 18:26:48 UTC
*** This bug has been confirmed by popular vote. ***
Comment 8 S. Burmeister 2011-06-15 10:47:41 UTC
This seems to be fixed in kmail 2.1.0
Comment 9 Aldoo 2011-06-16 17:46:49 UTC
Fixed for me too in 2.1.0. Both Bogofilter and SpamAssassin do tag my emails now.
Comment 10 S. Burmeister 2011-06-16 18:42:20 UTC
To be more precise. Tagging works for me, yet moving not. If I apply the filters manually the emails get moved to the junk folder but not automatically as other emails from my IMAP inbox.
Comment 11 Aldoo 2011-06-17 09:57:04 UTC
Indeed, same for me: tagging works but not moving.
Comment 12 Peter Hedlund 2011-06-20 23:43:22 UTC
There is another bug that also makes Bogofilter unusable, https://bugs.kde.org/show_bug.cgi?id=275209, by causing endless message duplications.

Packages for Kubuntu Natty from Kontact Updates PPA (4.6.0).
Comment 13 Georg Hennig 2011-08-01 18:51:30 UTC
I can confirm this bug: it still exists in Kmail 4.7.0.
Comment 14 Frank Steinmetzger 2011-09-05 11:49:43 UTC
Bogofilter works now with 4.7.0, but here, too, mails are not moved accordingly. Only when I press Ctrl+J (apply filters) on a recognised spam mail, it gets moved away.

Perhaps it’s only a wrong condition check which causes further filter processing to be aborted after the spam filter is finished?
Comment 15 Tobias Koenig 2011-09-17 21:15:45 UTC
Hej Frank,

adding the bogofilter header to the mail by the 'Pipe through' filter has been fixed in 4.7 and making the following move filter work has been done today.
So it works in master (and future 4.8).

Ciao,
Tobias
Comment 16 S. Burmeister 2012-02-04 16:54:27 UTC
I can confirm that it works in 4.8. Thanks for fixing.
Comment 17 Yuriy Kozlov 2014-11-17 16:43:38 UTC
I think I am still seeing this bug.

I set up spamassassin using the wizard, I marked some messages as spam and some messages as ham.  I keep getting more copies of the spam message and the warning: "Could not determine the UID for the newly created message on the server" every time I sync (IMAP).

I disabled the spamassassin filters and tried using bogofilter isntead.  Now I got a duplicate of each ham message, and get the warning "Could not determine the UID for the newly created message on the server" for each of those messages every time I sync.  The spam messages did get moved to the trash and I'm not getting duplicates of them using bogofilter.
Comment 18 Yuriy Kozlov 2014-11-17 16:44:32 UTC
This was using version 4.13.3 on Kubuntu 14.04.
Comment 19 Matija Šuklje 2017-03-23 15:31:21 UTC
This happens again on:
Magia 5

KMail 4.14.5
KDE 4.14.30
Bogofilter 1.2.4

…oddly enough, when both KMail and KDE were 4.14.5 it worked.
Comment 20 Matija Šuklje 2017-03-23 19:17:58 UTC
No idea what caused it, but I found it and here’s a fix/workaround…

Actual problem:
`~/.kde4/share/config/akonadi_mailfilter_agentrc` suddenly prepends my home directory to the bogofilter line.
e.g. it says:
`action-args-1=/home/hook/bogofilter -s`
…which is obviously wrong.

Fix/workaround:
change all such lines in the file (or via the KMail Filter dialog) to point to the actual command, which can be easily found by running `which bogofilter` in the console. Most likely this will be:
`action-args-1=/usr/bin/bogofilter -s`

Side-note:
The same applies for the antivirus scan filter and the `kmail_clamav.sh` line.

Closing the bug again, as it seems it’s somewhat different and the workaround is stated above.