isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit 16de402c9e90dc62cbbd920fdf9b19aed8980d38
parent efa062ccdb7e83976ca0402ec25e5c4f50a9cbd5
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Wed, 15 Sep 2004 09:06:36 +0000

when storing \seen messages, don't set the \recent flag on them. could
well be that this is incorrect, but some mailers need it that way.
when trashing messages, preserve their \recent status as well.

Diffstat:
Msrc/drv_maildir.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/drv_maildir.c b/src/drv_maildir.c @@ -981,7 +981,7 @@ maildir_store_msg( store_t *gctx, msg_data_t *data, int *uid ) return DRV_BOX_BAD; } close( fd ); - nfsnprintf( nbuf, sizeof(nbuf), "%s%s/new/%s%s", prefix, box, base, fbuf ); + nfsnprintf( nbuf, sizeof(nbuf), "%s%s/%s/%s%s", prefix, box, subdirs[!(data->flags & F_SEEN)], base, fbuf ); if (rename( buf, nbuf )) { perror( nbuf ); return DRV_BOX_BAD; @@ -1074,8 +1074,8 @@ maildir_trash_msg( store_t *gctx, message_t *gmsg ) for (;;) { nfsnprintf( buf, sizeof(buf), "%s/%s/%s", gctx->path, subdirs[gmsg->status & M_RECENT], msg->base ); s = strstr( msg->base, ":2," ); - nfsnprintf( nbuf, sizeof(nbuf), "%s%s/new/%ld.%d_%d.%s%s", gctx->conf->path, gctx->conf->trash, - time( 0 ), Pid, ++MaildirCount, Hostname, s ? s : "" ); + nfsnprintf( nbuf, sizeof(nbuf), "%s%s/%s/%ld.%d_%d.%s%s", gctx->conf->path, gctx->conf->trash, + subdirs[gmsg->status & M_RECENT], time( 0 ), Pid, ++MaildirCount, Hostname, s ? s : "" ); if (!rename( buf, nbuf )) break; if (!stat( buf, &st )) {