~ubuntu-branches/debian/sid/claws-mail/sid

« back to all changes in this revision

Viewing changes to src/plugins/bogofilter/bogofilter.c

  • Committer: Package Import Robot
  • Author(s): Ricardo Mones
  • Date: 2015-08-18 16:37:25 UTC
  • mfrom: (1.3.7)
  • Revision ID: package-import@ubuntu.com-20150818163725-1it32n9mzqkwy2ef
Tags: 3.12.0-1
* New upstream release:
- 'cannot reorganize mailboxes' (Closes: #777208)
- 'dropdown menu bar has disappeared…'(Closes: #778886)
- 'depends on plugins libraries'  (Closes: #779824)
- 'new upstream version (3.12.0)…' (Closes: #793665)
* 14CVE_2010_5109.patch, 15fix_crash_open_folder.patch,
  13desktop_file_categories.patch
- Remove patches applied upstream
* debian/control, debian/copyright, debian/claws-mail-managesieve*
- Add managesieve plugin (new in this release)
* debian/rules
- Set perl-plugin manpage release version automatically
* 12fix_manpage_header.patch
- Update patch to cope with upstream changes
* debian/control, debian/watch
- Update VCS-* and watch URLs (thanks Julian Wollrath)

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
static PrefParam param[] = {
89
89
        {"process_emails", "TRUE", &config.process_emails, P_BOOL,
90
90
         NULL, NULL, NULL},
91
 
        {"receive_spam", "TRUE", &config.receive_spam, P_BOOL,
 
91
        {"receive_spam", "1", &config.receive_spam, P_INT,
92
92
         NULL, NULL, NULL},
93
93
        {"save_folder", NULL, &config.save_folder, P_STRING,
94
94
         NULL, NULL, NULL},
319
319
                                        if (!whitelisted && parts && parts[0] && parts[1] && *parts[1] == 'S') {
320
320
 
321
321
                                                debug_print("message %d is spam\n", msginfo->msgnum);
322
 
                                                /* Spam will be filtered away */
323
 
                                                data->mail_filtering_data->filtered = g_slist_prepend(
324
 
                                                        data->mail_filtering_data->filtered, msginfo);
 
322
                                                /* Spam will be filtered away, unless we want "mark only".
 
323
                                                 * In that case, we want it among unfiltered messages, so
 
324
                                                 * it gets processed further. */
 
325
                                                if (config.receive_spam == SPAM_MARK_ONLY) {
 
326
                                                        data->mail_filtering_data->unfiltered = g_slist_prepend(
 
327
                                                                data->mail_filtering_data->unfiltered, msginfo);
 
328
                                                } else {
 
329
                                                        data->mail_filtering_data->filtered = g_slist_prepend(
 
330
                                                                data->mail_filtering_data->filtered, msginfo);
 
331
                                                }
325
332
                                                data->new_spams = g_slist_prepend(data->new_spams, msginfo);
326
333
 
327
334
                                        } else if (whitelisted && parts && parts[0] && parts[1] && 
584
591
                }
585
592
        }
586
593
 
587
 
        /* flag spams and delete them if !config.receive_spam 
588
 
         * (if config.receive_spam is set, we'll move them later) */
 
594
        /* flag spams and delete them if config.receive_spam == 0
 
595
         * (if config.receive_spam is set to 1, we'll move them later,
 
596
         * mark as spam only if set to 2) */
589
597
        for (cur = new_spams; cur; cur = cur->next) {
590
598
                MsgInfo *msginfo = (MsgInfo *)cur->data;
591
 
                if (config.receive_spam) {
 
599
                if (config.receive_spam != SPAM_DELETE) {
592
600
                        if (config.mark_as_read)
593
601
                                procmsg_msginfo_unset_flags(msginfo, ~0, 0);
594
602
                        procmsg_msginfo_set_flags(msginfo, MSG_SPAM, 0);
611
619
                        msg =  g_strdup_printf(_("The Bogofilter plugin couldn't filter "
612
620
                                           "a message. The command `%s %s %s` couldn't be run."), 
613
621
                                           bogo_args[0], bogo_args[1], bogo_args[2]);
614
 
                if (!prefs_common.no_recv_err_panel) {
 
622
                if (!prefs_common_get_prefs()->no_recv_err_panel) {
615
623
                        if (!warned_error) {
616
624
                                alertpanel_error("%s", msg);
617
625
                        }
627
635
                mail_filtering_data->filtered = NULL;
628
636
                mail_filtering_data->unfiltered = NULL;
629
637
        } else {
630
 
                if (config.receive_spam && new_spams) {
 
638
                if (config.receive_spam == SPAM_MARK_AND_SAVE && new_spams) {
631
639
                        FolderItem *save_folder = NULL;
632
640
 
633
641
                        if ((!config.save_folder) ||