From 42c9dde271cce6043e02e139142321aae760dd81 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 28 Dec 2006 09:26:24 +0000 Subject: filter junk mails on incorporation from local spool when filter_junk_on_recv is enabled. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1464 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 5 +++++ ChangeLog.ja | 5 +++++ libsylph/mbox.c | 19 +++++++++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1eae4d4..2b3ee236 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-12-28 + + * libsylph/mbox.c: proc_mbox(): filter junk mails when + filter_junk_on_recv is enabled. + 2006-12-28 * configure.in: check additional libraries (resolv, socket, nsl) diff --git a/ChangeLog.ja b/ChangeLog.ja index a12d87d7..1beda082 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,8 @@ +2006-12-28 + + * libsylph/mbox.c: proc_mbox(): filter_junk_on_recv が有効になっている + 場合迷惑メールをフィルタするようにした。 + 2006-12-28 * configure.in: 追加のライブラリをチェック(resolv, socket, nsl) diff --git a/libsylph/mbox.c b/libsylph/mbox.c index 3ecf61c5..7385c285 100644 --- a/libsylph/mbox.c +++ b/libsylph/mbox.c @@ -1,6 +1,6 @@ /* * LibSylph -- E-Mail client library - * Copyright (C) 1999-2005 Hiroyuki Yamamoto + * Copyright (C) 1999-2006 Hiroyuki Yamamoto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -204,9 +204,24 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, GHashTable *folder_table) fltinfo->flags.perm_flags = MSG_NEW|MSG_UNREAD; fltinfo->flags.tmp_flags = MSG_RECEIVED; - if (folder_table) + if (folder_table && prefs_common.enable_junk && + prefs_common.filter_junk_on_recv && + prefs_common.filter_junk_before) { + filter_apply(prefs_common.junk_fltlist, tmp_file, + fltinfo); + } + + if (!fltinfo->drop_done && folder_table) filter_apply(prefs_common.fltlist, tmp_file, fltinfo); + if (!fltinfo->drop_done && + folder_table && prefs_common.enable_junk && + prefs_common.filter_junk_on_recv && + !prefs_common.filter_junk_before) { + filter_apply(prefs_common.junk_fltlist, tmp_file, + fltinfo); + } + if (fltinfo->actions[FLT_ACTION_MOVE] == FALSE && fltinfo->actions[FLT_ACTION_DELETE] == FALSE) { if (folder_item_add_msg(dest, tmp_file, &fltinfo->flags, -- cgit v1.2.3