Bug 238875 - offlineimap: interop with dovecot SPAM folders.
Summary: offlineimap: interop with dovecot SPAM folders.
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.13.3
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 283340 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-26 12:43 UTC by David Laban
Modified: 2015-04-12 10:24 UTC (History)
2 users (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 David Laban 2010-05-26 12:43:32 UTC
Version:           1.13.3 (using KDE 4.4.3) 
OS:                Linux

Trying to copy things to the spam folder doesn't work with my company's server.
The destination folder was: work/Spam.
The server reported:
[CANNOT] Cannot APPEND to a SPAM folder.

A quick google for the error message returns http://www.freenux.org/cgi-bin/gitweb.cgi?p=dovecot-antispam.git;a=commitdiff;h=513d1c5fa703817ae8fd08fab86709a9b5c111e4
+                       /*
+                        * The client is APPENDing a message to a SPAM folder
+                        * so we try to train the backend on it. For most of
+                        * the backends, that can only succeed if the message
+                        * contains appropriate information.
+                        *
+                        * This happens especially when offlineimap is used and
+                        * the user moved a message to the SPAM folder while
+                        * offline---offlineimap cannot reproduce the COPY but
+                        * rather APPENDs the moved message on the next sync.
+                        *
+                        * This could be a bad if the spam headers were not
+                        * generated on our server, but since the user can
+                        * always APPEND to another folder and then COPY to a
+                        * SPAM folder backends need to be prepared for cases
+                        * like this anyway. With dspam, for example, the worst
+                        * that can happen is that the APPEND fails with a
+                        * training error from dspam.
+                        *
+                        * Unfortunately, we cannot handle the cases where
+                        *  (1) the user moved a message from one folder that
+                        *      contains SPAM to another folder containing SPAM
+                        *  (2) the user moved a message out of the SPAM folder
+                        *  (3) the user recovered a message from trash
+                        *
+                        * Because of these limitations, this behaviour needs
+                        * to be enabled with an option.
+                        */
+                       if (!antispam_can_append_to_spam) {
+                               ret = -1;
+                               mail_storage_set_error(
+                                       save_dest_mail->box->storage,
+                                       "Cannot APPEND to a SPAM folder.");
+                               break;
+                       }

Reproducible: Always

Steps to Reproduce:
Set up offline imap account on company server which uses dovecot+dspam.
Drag mail from inbox to spam folder.
Hit F5 in the spam folder to make it sync.

Actual Results:  
Error while uploading message
Could not upload the message dated Yesterday 10:01:34 from "HK DISNEY LOTTERY" <hkdesneylottery@126.com> with subject "HONG KONG DISNEY LOTTERY 2010" to the server.
The destination folder was: work/Spam.
The server reported:
[CANNOT] Cannot APPEND to a SPAM folder.

Expected Results:  
kmail should try to use COPY rather than APPEND for moving messages around, if possible (would this also be more efficient?).

work-around: create an additional standard IMAP account in kmail, and only use Disconnected IMAP for when you're on the train etc. Would be nice to only need one imap account though.

OS: Linux (x86_64) release 2.6.32-trunk-amd64
Compiler: cc
Comment 1 Elvis Pranskevichus 2010-11-08 05:45:44 UTC
As the comment from your excerpt states, you can enable APPEND to spam folders by setting antispam_can_append_to_spam = yes in the plugins section of dovecot.conf.  The limitations listed do apply, though.
Comment 2 Christophe Marin 2011-10-12 15:49:24 UTC
*** Bug 283340 has been marked as a duplicate of this bug. ***
Comment 3 Laurent Montel 2015-04-12 10:24:47 UTC
Thank you for taking the time to file a bug report.

KMail2 was released in 2011, and the entire code base went through significant changes. We are currently in the process of porting to Qt5 and KF5. It is unlikely that these bugs are still valid in KMail2.

We welcome you to try out KMail 2 with the KDE 4.14 release and give your feedback.