maildir-copy.c revision db1ee4a91a6572602302115e02146b29adea3a54
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "ioloop.h"
#include "maildir-index.h"
#include "maildir-storage.h"
#include "mail-custom-flags.h"
#include "mail-index-util.h"
#include "index-messageset.h"
#include <stdlib.h>
#include <unistd.h>
struct rollback {
const char *fname;
};
struct mail_index_record *rec,
{
const char *path;
return -1;
/* probably in new/ dir */
return 1;
return -1;
}
return -1;
return -1;
}
}
return 1;
return -1;
}
return -1;
return -1;
}
return 0;
}
struct index_mailbox *src,
struct index_mailbox *dest)
{
const struct messageset_mail *mail;
enum mail_flags flags;
const char **custom_flags;
ret = 1;
ret = -1;
break;
}
/* link the file */
t_push();
dest_fname, NULL);
for (i = 0;; i++) {
if (ret > 0) {
break;
}
if (ret < 0)
break;
if (i == 10) {
"File name keeps changing, "
"copy failed");
break;
}
break;
if (!found)
break;
}
t_pop();
}
if (ret <= 0) {
t_push();
t_pop();
}
}
return ret;
}
struct index_mailbox *dest,
const char *messageset, int uidset)
{
struct messageset_context *ctx;
return -1;
if (ret2 < 0)
ret = -1;
"Some of the requested messages no longer exist.");
ret = -1;
}
}
const char *messageset, int uidset)
{
"Destination mailbox is read-only");
return FALSE;
}
/* both source and destination mailbox are in maildirs and
copy_with_hardlinks option is on, do it */
switch (copy_with_hardlinks(ibox,
case 1:
return TRUE;
case 0:
/* non-fatal hardlinking failure, try the slow way */
break;
default:
return FALSE;
}
}
}