aboutsummaryrefslogtreecommitdiffstats
path: root/antispam-plugin.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-10-01 22:32:10 +0200
committerJohannes Berg <johannes@sipsolutions.net>2007-10-01 22:32:10 +0200
commite0a10f38cd617c4483d4c67b564165a65bb46de2 (patch)
tree51053cb014de3514f85edcb6bd2a240850a3c6ec /antispam-plugin.c
parentb359532647ccd3ac3221dcb37dca7bdb4cbb2e58 (diff)
downloaddovecot-antispam-e0a10f38cd617c4483d4c67b564165a65bb46de2.tar.gz
dovecot-antispam-e0a10f38cd617c4483d4c67b564165a65bb46de2.tar.xz
dovecot-antispam-e0a10f38cd617c4483d4c67b564165a65bb46de2.zip
introduce 'unsure' folder feature, fix bug from previous commit
Diffstat (limited to 'antispam-plugin.c')
-rw-r--r--antispam-plugin.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/antispam-plugin.c b/antispam-plugin.c
index 9a84c07..ea7e426 100644
--- a/antispam-plugin.c
+++ b/antispam-plugin.c
@@ -47,6 +47,7 @@ static char *default_spam_folders[] = {
NULL
};
static char **spam_folders = default_spam_folders;
+static char **unsure_folders = NULL;
static bool mailbox_in_list(struct mailbox *box, char **list)
{
@@ -72,6 +73,11 @@ bool mailbox_is_trash(struct mailbox *box)
return mailbox_in_list(box, trash_folders);
}
+bool mailbox_is_unsure(struct mailbox *box)
+{
+ return mailbox_in_list(box, unsure_folders);
+}
+
void antispam_plugin_init(void)
{
char *tmp, **iter;
@@ -106,6 +112,19 @@ void antispam_plugin_init(void)
} else
debug("antispam: no spam folders\n");
+ tmp = getenv("ANTISPAM_UNSURE");
+ if (tmp)
+ unsure_folders = p_strsplit(global_pool, tmp, ";");
+
+ if (unsure_folders) {
+ iter = unsure_folders;
+ while (*iter) {
+ debug("antispam: \"%s\" is unsure folder\n", *iter);
+ iter++;
+ }
+ } else
+ debug("antispam: no unsure folders\n");
+
backend_init(global_pool);
antispam_next_hook_mail_storage_created = hook_mail_storage_created;