ok = imap_select(session, IMAP_FOLDER(folder), item,
NULL, NULL, NULL, NULL, NULL, FALSE);
if (ok != MAILIMAP_NO_ERROR) {
- g_warning("can't select mailbox %s\n", item->path);
+ g_warning("can't select mailbox %s", item->path);
g_free(filename);
return NULL;
}
ok = imap_cmd_fetch(session, (guint32)uid, filename, headers, body);
if (ok != MAILIMAP_NO_ERROR) {
- g_warning("can't fetch message %d\n", uid);
+ g_warning("can't fetch message %d", uid);
g_free(filename);
return NULL;
}
&new_uid);
if (ok != MAILIMAP_NO_ERROR) {
- g_warning("can't append message %s\n", real_file);
+ g_warning("can't append message %s", real_file);
g_free(real_file);
g_free(destdir);
statusbar_progress_all(0,0,0);
msginfo = (MsgInfo *)msglist->data;
src = msginfo->folder;
if (!same_dest_ok && src == dest) {
- g_warning("the src folder is identical to the dest.\n");
+ g_warning("the src folder is identical to the dest.");
return -1;
}
if (!is_dir_exist(cache_path))
make_dir_hier(cache_path);
if (is_file_exist(real_file) && is_dir_exist(cache_path)) {
- copy_file(real_file, cache_file, TRUE);
- debug_print("copied to cache: %s\n", cache_file);
+ if (copy_file(real_file, cache_file, TRUE) < 0)
+ debug_print("couldn't cache to %s: %s\n", cache_file,
+ strerror(errno));
+ else
+ debug_print("copied to cache: %s\n", cache_file);
}
g_free(real_file);
g_free(cache_file);
case MATCHCRITERIA_TO_OR_CC:
case MATCHCRITERIA_SUBJECT:
case MATCHCRITERIA_REFERENCES:
+ case MATCHCRITERIA_MESSAGEID:
case MATCHCRITERIA_INREPLYTO:
case MATCHCRITERIA_AGE_GREATER:
case MATCHCRITERIA_AGE_LOWER:
case MATCHCRITERIA_NOT_MESSAGE: invert = TRUE; matchertype = MATCHCRITERIA_MESSAGE; break;
case MATCHCRITERIA_NOT_BODY_PART: invert = TRUE; matchertype = MATCHCRITERIA_BODY_PART; break;
case MATCHCRITERIA_NOT_TO_AND_NOT_CC: invert = TRUE; matchertype = MATCHCRITERIA_TO_OR_CC; break;
+ case MATCHCRITERIA_NOT_MESSAGEID: invert = TRUE; matchertype = MATCHCRITERIA_MESSAGEID; break;
case MATCHCRITERIA_NOT_INREPLYTO: invert = TRUE; matchertype = MATCHCRITERIA_INREPLYTO; break;
}
result = imap_search_new(IMAP_SEARCH_CRITERIA_TAG, NULL, RTAG_JUNK, 0);
break;
+ case MATCHCRITERIA_MESSAGEID:
+ result = imap_search_new(IMAP_SEARCH_CRITERIA_HEADER, "Message-ID", match->expr, 0);
+ break;
+
case MATCHCRITERIA_INREPLYTO:
result = imap_search_new(IMAP_SEARCH_CRITERIA_HEADER, "In-Reply-To", match->expr, 0);
break;
new_item = imap_create_folder(folder, item, name);
if (!new_item) {
- g_warning("Can't create '%s'\n", name);
+ g_warning("Can't create '%s'", name);
if (!folder->inbox) return NULL;
new_item = imap_create_folder(folder, folder->inbox, name);
if (!new_item)
- g_warning("Can't create '%s' under INBOX\n", name);
+ g_warning("Can't create '%s' under INBOX", name);
else
new_item->stype = stype;
} else
g_return_val_if_fail(folder != NULL, NULL);
g_return_val_if_fail(folder->account != NULL, NULL);
+#ifdef G_OS_WIN32
+ gchar *sanitized_dirname = g_strdup(folder->account->recv_server);
+ g_strdelimit(sanitized_dirname, ":", ',');
+#endif
+
folder_path = g_strconcat(get_imap_cache_dir(),
G_DIR_SEPARATOR_S,
+#ifdef G_OS_WIN32
+ sanitized_dirname,
+#else
folder->account->recv_server,
+#endif
G_DIR_SEPARATOR_S,
folder->account->userid,
NULL);
+#ifdef G_OS_WIN32
+ g_free(sanitized_dirname);
+#endif
return folder_path;
}
if (strchr(name, imap_get_path_separator(session, IMAP_FOLDER(folder), item->path, &ok)) != NULL ||
is_fatal(ok)) {
- g_warning(_("New folder name must not contain the namespace "
- "path separator"));
+ g_warning("New folder name must not contain the namespace "
+ "path separator");
return -1;
}
g_free(path);
cache_dir = folder_item_get_path(item);
if (is_dir_exist(cache_dir) && remove_dir_recursive(cache_dir) < 0)
- g_warning("can't remove directory '%s'\n", cache_dir);
+ g_warning("can't remove directory '%s'", cache_dir);
g_free(cache_dir);
folder_item_remove(item);
return 0;
mailimap_mailbox_data_status_free(data_status);
if (got_values != mask) {
- g_warning("status: incomplete values received (%d)\n", got_values);
+ g_warning("status: incomplete values received (%d)", got_values);
}
return MAILIMAP_NO_ERROR;
}
gint ok = MAILIMAP_NO_ERROR;
oldpathlen = strlen(oldpath);
if (strncmp(oldpath, item->path, oldpathlen) != 0) {
- g_warning("path doesn't match: %s, %s\n", oldpath, item->path);
+ g_warning("path doesn't match: %s, %s", oldpath, item->path);
return TRUE;
}
ok = imap_set_message_flags(session, IMAP_FOLDER_ITEM(item),
data->msglist, flags_value, NULL, flags_set);
} else {
- g_warning("can't select mailbox %s\n", item->path);
+ g_warning("can't select mailbox %s", item->path);
}
if (!is_fatal(ok))
ok = imap_set_message_flags(session, IMAP_FOLDER_ITEM(item),
data->msglist, 0, &list, tags_set);
} else {
- g_warning("can't select mailbox %s\n", item->path);
+ g_warning("can't select mailbox %s", item->path);
}
if (!is_fatal(ok))
}
if (!all && dup_name[strlen(dup_name)-1] == '/') {
- dup_name[strlen(dup_name)-1] = '\0';
+ g_free(base);
+ free(dup_name);
+ continue;
}
loc_name = imap_modified_utf7_to_utf8(base, FALSE);
GList *list;
gboolean short_timeout;
#ifdef HAVE_NETWORKMANAGER_SUPPORT
- GError *error;
-#endif
+ GError *error = NULL;
-#ifdef HAVE_NETWORKMANAGER_SUPPORT
- error = NULL;
short_timeout = !networkmanager_is_online(&error);
if(error) {
short_timeout = TRUE;