lib/maildir: log when move-source still exists

Instead of raising an error... it *seems* this could happen with some mail
sync programs.
This commit is contained in:
Dirk-Jan C. Binnema
2020-11-01 11:54:57 +02:00
parent 812b5c3e65
commit 72d9dba7cc

View File

@ -900,13 +900,15 @@ msg_move_check_post (const char *src, const char *dst, GError **err)
(err, MU_ERROR_FILE, "can't find target (%s->%s)", src, dst); (err, MU_ERROR_FILE, "can't find target (%s->%s)", src, dst);
if (access (src, F_OK) == 0) { if (access (src, F_OK) == 0) {
if (g_strcmp0(src, dst) == 0) { if (g_strcmp0(src, dst) == 0) {
g_warning ("moved %s to itself", src); g_warning ("moved %s to itself", src);
return TRUE; return TRUE;
} }
return mu_util_g_set_error /* this could happen if some other tool (for mail syncing) is
(err, MU_ERROR_FILE, "source still there (%s->%s)", * interfering */
g_debug ("the source is still there (%s->%s)",
src, dst); src, dst);
} }
@ -992,6 +994,9 @@ mu_maildir_move_message (const char* oldpath, const char* targetmdir,
} }
if (!src_is_target) { if (!src_is_target) {
g_debug ("moving %s (%s, %x, %d) --> %s",
oldpath, targetmdir, newflags, new_name,
newfullpath);
rv = msg_move (oldpath, newfullpath, err); rv = msg_move (oldpath, newfullpath, err);
if (!rv) { if (!rv) {
g_free (newfullpath); g_free (newfullpath);