Browse Source

do not trash expired messages

we are not actually deleting them, so there is no point in saving them
in the trash.
Oswald Buddenhagen 11 years ago
parent
commit
f1eea7d9a5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/sync.c

+ 1 - 1
src/sync.c

@@ -1628,7 +1628,7 @@ msgs_flags_set( sync_vars_t *svars, int t )
 	    (svars->ctx[t]->conf->trash || (svars->ctx[1-t]->conf->trash && svars->ctx[1-t]->conf->trash_remote_new))) {
 	    (svars->ctx[t]->conf->trash || (svars->ctx[1-t]->conf->trash && svars->ctx[1-t]->conf->trash_remote_new))) {
 		debug( "trashing in %s\n", str_ms[t] );
 		debug( "trashing in %s\n", str_ms[t] );
 		for (tmsg = svars->ctx[t]->msgs; tmsg; tmsg = tmsg->next)
 		for (tmsg = svars->ctx[t]->msgs; tmsg; tmsg = tmsg->next)
-			if (tmsg->flags & F_DELETED) {
+			if ((tmsg->flags & F_DELETED) && (t == M || !tmsg->srec || !(tmsg->srec->status & (S_EXPIRE|S_EXPIRED)))) {
 				if (svars->ctx[t]->conf->trash) {
 				if (svars->ctx[t]->conf->trash) {
 					if (!svars->ctx[t]->conf->trash_only_new || !tmsg->srec || tmsg->srec->uid[1-t] < 0) {
 					if (!svars->ctx[t]->conf->trash_only_new || !tmsg->srec || tmsg->srec->uid[1-t] < 0) {
 						debug( "%s: trashing message %d\n", str_ms[t], tmsg->uid );
 						debug( "%s: trashing message %d\n", str_ms[t], tmsg->uid );