2006-05-15 [colin] 2.2.0cvs18
[claws.git] / src / procmsg.c
index 72ef6c81f4ba75731ca71f6a3a72810bfed91a02..40d247a16cdf715f5e5ec55159170f6c2372e254 100644 (file)
@@ -633,7 +633,7 @@ void procmsg_get_filter_keyword(MsgInfo *msginfo, gchar **header, gchar **key,
                } else if (hentry[H_SENDER].body != NULL) {
                        SET_FILTER_KEY("header \"Sender\"", H_SENDER);
                } else if (hentry[H_LIST_POST].body != NULL) {
-                       SET_FILTER_KEY("header \"Sender\"", H_LIST_POST);
+                       SET_FILTER_KEY("header \"List-Post\"", H_LIST_POST);
                } else if (msginfo->to) {
                        *header = g_strdup("to");
                        *key = g_strdup(msginfo->to);
@@ -1209,6 +1209,18 @@ MsgInfo *procmsg_msginfo_get_full_info(MsgInfo *msginfo)
 
        /* CLAWS: make sure we add the missing members; see: 
         * procheader.c::procheader_get_headernames() */
+       if (!msginfo->list_post)
+               msginfo->list_post = g_strdup(full_msginfo->list_post);
+       if (!msginfo->list_subscribe)
+               msginfo->list_subscribe = g_strdup(full_msginfo->list_subscribe);
+       if (!msginfo->list_unsubscribe)
+               msginfo->list_unsubscribe = g_strdup(full_msginfo->list_unsubscribe);
+       if (!msginfo->list_help)
+               msginfo->list_help = g_strdup(full_msginfo->list_help);
+       if (!msginfo->list_archive)
+               msginfo->list_archive= g_strdup(full_msginfo->list_archive);
+       if (!msginfo->list_owner)
+               msginfo->list_owner = g_strdup(full_msginfo->list_owner);
        if (!msginfo->xface)
                msginfo->xface = g_strdup(full_msginfo->xface);
        if (!msginfo->face)
@@ -1266,6 +1278,13 @@ void procmsg_msginfo_free(MsgInfo *msginfo)
        g_free(msginfo->inreplyto);
        g_free(msginfo->xref);
 
+       g_free(msginfo->list_post);
+       g_free(msginfo->list_subscribe);
+       g_free(msginfo->list_unsubscribe);
+       g_free(msginfo->list_help);
+       g_free(msginfo->list_archive);
+       g_free(msginfo->list_owner);
+
        g_free(msginfo->partial_recv);
        g_free(msginfo->account_server);
        g_free(msginfo->account_login);
@@ -1432,7 +1451,11 @@ static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_ses
        if (encrypt) {
                MimeInfo *mimeinfo;
 
-               save_clear_text = (mailac != NULL && mailac->save_encrypted_as_clear_text);
+               if (mailac && mailac->save_encrypted_as_clear_text 
+               &&  !mailac->encrypt_to_self)
+                       save_clear_text = TRUE;
+               else
+                       save_clear_text = FALSE;
 
                fclose(fp);
                fp = NULL;
@@ -1513,7 +1536,9 @@ static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_ses
                                mailval = send_message_smtp(&tmp_ac, to_list, fp);
                        }
                }
-       }
+       } else if (!to_list && !newsgroup_list) 
+               mailval = -1;
+
 
        fseek(fp, filepos, SEEK_SET);
        if (newsgroup_list && (mailval == 0)) {
@@ -2078,8 +2103,7 @@ int procmsg_spam_learner_learn (MsgInfo *info, GSList *list, gboolean spam)
 static gchar *spam_folder_item = NULL;
 void procmsg_spam_set_folder (const char *item_identifier)
 {
-       if (spam_folder_item)
-               g_free(spam_folder_item);
+       g_free(spam_folder_item);
        if (item_identifier)
                spam_folder_item = g_strdup(item_identifier);
        else