X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=src%2Fetpan%2Fimap-thread.c;h=30f3a6014ae3a2e924c5157da02ba2b8af160f81;hp=5f4ec07e79c58a061bb19116d482baff004f199d;hb=a5ccbcc1488aae3fbd986c85e0505b9cf63c01c4;hpb=f9a6bae9b6907e9f3c78fb3a4a1e6b89e2ea8aed diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c index 5f4ec07e7..30f3a6014 100644 --- a/src/etpan/imap-thread.c +++ b/src/etpan/imap-thread.c @@ -1446,6 +1446,12 @@ int imap_threaded_select(Folder * folder, const char * mb, case MAILIMAP_FLAG_KEYWORD: if (!strcasecmp(flag->fl_flag->fl_data.fl_keyword, "$Forwarded")) c_flag = IMAP_FLAG_FORWARDED; + if (!strcasecmp(flag->fl_flag->fl_data.fl_keyword, "Junk")) + c_flag = IMAP_FLAG_SPAM; + if (!strcasecmp(flag->fl_flag->fl_data.fl_keyword, "NonJunk") || + !strcasecmp(flag->fl_flag->fl_data.fl_keyword, "NoJunk") || + !strcasecmp(flag->fl_flag->fl_data.fl_keyword, "NotJunk")) + c_flag = IMAP_FLAG_HAM; break; default: break; @@ -1672,6 +1678,14 @@ static void search_run(struct etpan_thread_op * op) NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL); break; + case IMAP_SEARCH_TYPE_SPAM: + search_type_key = mailimap_search_key_new(MAILIMAP_SEARCH_KEY_KEYWORD, + NULL, NULL, NULL, NULL, NULL, + strdup("Junk"), NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, 0, + NULL, NULL, NULL, NULL, NULL, + NULL, 0, NULL, NULL, NULL); + break; } if (search_type_key != NULL) { @@ -2530,6 +2544,12 @@ static int imap_flags_to_flags(struct mailimap_msg_att_dynamic * att_dyn, GSList case MAILIMAP_FLAG_KEYWORD: if (!strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, "$Forwarded")) flags |= MSG_FORWARDED; + else if (!strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, "Junk")) + flags |= MSG_SPAM; + else if (!strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, "NonJunk") || + !strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, "NoJunk") || + !strcasecmp(flag_fetch->fl_flag->fl_data.fl_keyword, "NotJunk")) + flags &= ~MSG_SPAM; else if (s_tags) tags = g_slist_prepend(tags, g_strdup(flag_fetch->fl_flag->fl_data.fl_keyword)); break;