#define MX_COMMAND(idx,cmd) ((mx_t*) MailboxFormats->data[idx])->cmd
#define MX_IDX(idx) (idx >= 0 && idx < MailboxFormats->length)
#define MX_COMMAND(idx,cmd) ((mx_t*) MailboxFormats->data[idx])->cmd
#define MX_IDX(idx) (idx >= 0 && idx < MailboxFormats->length)
static int invoke_dotlock (const char *path, int dummy, int flags, int retry)
{
char cmd[LONG_STRING + _POSIX_PATH_MAX];
static int invoke_dotlock (const char *path, int dummy, int flags, int retry)
{
char cmd[LONG_STRING + _POSIX_PATH_MAX];
unlockit.l_type = F_UNLCK;
unlockit.l_whence = SEEK_SET;
fcntl (fd, F_SETLK, &unlockit);
unlockit.l_type = F_UNLCK;
unlockit.l_whence = SEEK_SET;
fcntl (fd, F_SETLK, &unlockit);
/* special case for appending to compressed folders -
* even if we can not open them for reading */
if (mutt_can_append_compressed (ctx->path))
mutt_open_append_compressed (ctx);
/* special case for appending to compressed folders -
* even if we can not open them for reading */
if (mutt_can_append_compressed (ctx->path))
mutt_open_append_compressed (ctx);
if (stat (ctx->path, &sb) == 0) {
ctx->magic = mx_get_magic (ctx->path);
if (stat (ctx->path, &sb) == 0) {
ctx->magic = mx_get_magic (ctx->path);
hash_destroy (&ctx->id_hash, NULL);
mutt_clear_threads (ctx);
for (i = 0; i < ctx->msgcount; i++)
hash_destroy (&ctx->id_hash, NULL);
mutt_clear_threads (ctx);
for (i = 0; i < ctx->msgcount; i++)
/* the 1 is only of interest for IMAP and means EXPUNGE */
rc = MX_COMMAND(ctx->magic-1,mx_sync_mailbox(ctx,1,index_hint));
/* the 1 is only of interest for IMAP and means EXPUNGE */
rc = MX_COMMAND(ctx->magic-1,mx_sync_mailbox(ctx,1,index_hint));
isSpool = mutt_is_spool (ctx->path) && !mutt_is_spool (mbox);
}
mutt_expand_path (mbox, sizeof (mbox));
isSpool = mutt_is_spool (ctx->path) && !mutt_is_spool (mbox);
}
mutt_expand_path (mbox, sizeof (mbox));
if (option (OPTMARKOLD)) {
for (i = 0; i < ctx->msgcount; i++) {
if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->old)
if (option (OPTMARKOLD)) {
for (i = 0; i < ctx->msgcount; i++) {
if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->old)
/* allow IMAP to preserve the deleted flag across sessions */
if (ctx->magic == M_IMAP) {
if ((check = imap_sync_mailbox (ctx, purge, index_hint)) != 0) {
/* allow IMAP to preserve the deleted flag across sessions */
if (ctx->magic == M_IMAP) {
if ((check = imap_sync_mailbox (ctx, purge, index_hint)) != 0) {
if (ctx->id_hash && ctx->hdrs[i]->env->message_id)
hash_delete (ctx->id_hash, ctx->hdrs[i]->env->message_id,
ctx->hdrs[i], NULL);
if (ctx->id_hash && ctx->hdrs[i]->env->message_id)
hash_delete (ctx->id_hash, ctx->hdrs[i]->env->message_id,
ctx->hdrs[i], NULL);
km_find_func (MENU_MAIN, OP_TOGGLE_WRITE)))
snprintf (tmp, sizeof (tmp), _(" Press '%s' to toggle write"), buf);
else
km_find_func (MENU_MAIN, OP_TOGGLE_WRITE)))
snprintf (tmp, sizeof (tmp), _(" Press '%s' to toggle write"), buf);
else
if (ctx->magic == M_IMAP)
rc = imap_sync_mailbox (ctx, purge, index_hint);
else
if (ctx->magic == M_IMAP)
rc = imap_sync_mailbox (ctx, purge, index_hint);
else
mutt_message (_("%d kept, %d deleted."), msgcount - deleted, deleted);
mutt_sleep (0);
mutt_message (_("%d kept, %d deleted."), msgcount - deleted, deleted);
mutt_sleep (0);
* at least with the new threading code.
*/
if (purge || (ctx->magic != M_MAILDIR && ctx->magic != M_MH)) {
* at least with the new threading code.
*/
if (purge || (ctx->magic != M_MAILDIR && ctx->magic != M_MH)) {
{
mx_update_tables (ctx, 1);
mutt_sort_headers (ctx, 1); /* rethread from scratch */
{
mx_update_tables (ctx, 1);
mutt_sort_headers (ctx, 1); /* rethread from scratch */
if (!MX_IDX(dest->magic-1)) {
debug_print (1, ("function unimplemented for mailbox type %d.\n", dest->magic));
if (!MX_IDX(dest->magic-1)) {
debug_print (1, ("function unimplemented for mailbox type %d.\n", dest->magic));
- if (WithCrypto) {
- /* NOTE: this _must_ be done before the check for mailcap! */
- h->security = crypt_query (h->content);
- }
+ /* NOTE: this _must_ be done before the check for mailcap! */
+ h->security = crypt_query (h->content);
list_push_back (&MailboxFormats, (void*) mmdf_reg_mx ());
list_push_back (&MailboxFormats, (void*) mh_reg_mx ());
list_push_back (&MailboxFormats, (void*) maildir_reg_mx ());
list_push_back (&MailboxFormats, (void*) mmdf_reg_mx ());
list_push_back (&MailboxFormats, (void*) mh_reg_mx ());
list_push_back (&MailboxFormats, (void*) maildir_reg_mx ());
#ifdef DEBUG
/* check module registration for completeness with debug versions */
#define EXITWITHERR(m) do { fprintf(stderr, "error: incomplete mx module: %s is missing for type %i\n",m,i);exit(1); } while (0)
#ifdef DEBUG
/* check module registration for completeness with debug versions */
#define EXITWITHERR(m) do { fprintf(stderr, "error: incomplete mx module: %s is missing for type %i\n",m,i);exit(1); } while (0)
for (i = 0; i < Incoming->length; i++) {
b = (BUFFY*) Incoming->data[i];
magic = mx_get_magic (b->path);
for (i = 0; i < Incoming->length; i++) {
b = (BUFFY*) Incoming->data[i];
magic = mx_get_magic (b->path);