aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-04-23 10:15:45 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-04-23 10:15:45 +0800
commitdfc8e2ad3f8f0ce91c16a6538e28491699b0bc99 (patch)
tree945e6c2a77ac77d02038ce3ecd423c8a19a26660 /mail/mail-ops.c
parent29b0f2cffcc43b4d0d6ebf194ed8bc17fccd777f (diff)
downloadgsoc2013-evolution-dfc8e2ad3f8f0ce91c16a6538e28491699b0bc99.tar
gsoc2013-evolution-dfc8e2ad3f8f0ce91c16a6538e28491699b0bc99.tar.gz
gsoc2013-evolution-dfc8e2ad3f8f0ce91c16a6538e28491699b0bc99.tar.bz2
gsoc2013-evolution-dfc8e2ad3f8f0ce91c16a6538e28491699b0bc99.tar.lz
gsoc2013-evolution-dfc8e2ad3f8f0ce91c16a6538e28491699b0bc99.tar.xz
gsoc2013-evolution-dfc8e2ad3f8f0ce91c16a6538e28491699b0bc99.tar.zst
gsoc2013-evolution-dfc8e2ad3f8f0ce91c16a6538e28491699b0bc99.zip
Only set the X-Evolution-* header if that value is non-NULL.
2001-04-22 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (composer_get_message): Only set the X-Evolution-* header if that value is non-NULL. * mail-ops.c (mail_send_message): Lets do proper refcounting on the sent-folder. Also, g_strdup() the sent_folder_uri since we later free it. If we don't, then we get lovely corrupt memory. svn path=/trunk/; revision=9498
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 1ee9de5369..badb3b777f 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -502,31 +502,33 @@ mail_send_message(CamelMimeMessage *message, const char *destination, CamelFilte
header = camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Account");
if (header) {
const MailConfigAccount *account;
-
+
account = mail_config_get_account_by_name (header);
camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Account");
if (account) {
transport_url = g_strdup (account->transport->url);
camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Transport");
- sent_folder_uri = account->sent_folder_uri;
+ sent_folder_uri = g_strdup (account->sent_folder_uri);
camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc");
}
}
+
if (!transport_url) {
header = camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Transport");
if (header) {
- transport_url = g_strstrip(g_strdup (header));
+ transport_url = g_strstrip (g_strdup (header));
camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Transport");
}
}
+
if (!sent_folder_uri) {
header = camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc");
if (header) {
- sent_folder_uri = g_strstrip(g_strdup (header));
+ sent_folder_uri = g_strstrip (g_strdup (header));
camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc");
}
}
-
+
xport = camel_session_get_transport (session, transport_url ? transport_url : destination, ex);
g_free (transport_url);
if (!xport) {
@@ -553,13 +555,18 @@ mail_send_message(CamelMimeMessage *message, const char *destination, CamelFilte
folder = mail_tool_uri_to_folder (sent_folder_uri, NULL);
if (!folder) {
/* FIXME */
+ camel_object_ref (CAMEL_OBJECT (sent_folder));
folder = sent_folder;
}
- } else
+ } else {
+ camel_object_ref (CAMEL_OBJECT (sent_folder));
folder = sent_folder;
-
- if (folder)
+ }
+
+ if (folder) {
camel_folder_append_message (folder, message, info, ex);
+ camel_object_unref (CAMEL_OBJECT (folder));
+ }
camel_message_info_free (info);
}
@@ -997,7 +1004,6 @@ add_vtrash_info (CamelFolderInfo *info)
g_return_if_fail (info != NULL);
for (fi = info; fi->sibling; fi = fi->sibling) {
- g_warning ("add_vtrash_info(): url is %s", fi->url);
if (!strcmp (fi->name, _("Trash")))
break;
}