2006-05-15 [colin] 2.2.0cvs18
[claws.git] / src / procmsg.c
index 7b1a5f90669d6d08a57cd20abd5ce2f329f2b730..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)) {
@@ -1589,9 +1614,9 @@ static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_ses
                FolderItem *item;
                
                if (replymessageid != NULL)
-                       tokens = g_strsplit(replymessageid, "\x7f", 0);
+                       tokens = g_strsplit(replymessageid, "\t", 0);
                else
-                       tokens = g_strsplit(fwdmessageid, "\x7f", 0);
+                       tokens = g_strsplit(fwdmessageid, "\t", 0);
                item = folder_find_item_from_identifier(tokens[0]);
 
                /* check if queued message has valid folder and message id */
@@ -1983,18 +2008,15 @@ gboolean procmsg_msginfo_filter(MsgInfo *msginfo)
                        
        mail_filtering_data.msginfo = msginfo;                  
        if (hooks_invoke(MAIL_FILTERING_HOOKLIST, &mail_filtering_data)) {
-               hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
                return TRUE;
        }
 
        /* filter if enabled in prefs or move to inbox if not */
        if((filtering_rules != NULL) &&
           filter_message_by_msginfo(filtering_rules, msginfo)) {
-               hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
                return TRUE;
        }
                
-       hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
        return FALSE;
 }
 
@@ -2081,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