CVS commit by ossi: 

backport:
- sanitize flag handling of expired messages
- don't record we synced flags if we didn't
- remove now superfluous temporary rflags


  M +8 -10     sync.c   1.43.2.1


--- isync/src/sync.c  #1.43:1.43.2.1
@@ -252,5 +252,5 @@ sync_old( int tops, store_t *sctx, store
        driver_t *tdriver = tctx->conf->driver, *sdriver = sctx->conf->driver;
        int uid, tuid, unex;
-       unsigned char sflags, aflags, dflags, rflags;
+       unsigned char sflags, aflags, dflags;
        msg_data_t msgdata;
 
@@ -333,18 +333,16 @@ sync_old( int tops, store_t *sctx, store
                        if (srec->status & S_EXPIRED) {
                                if (!pull) {
-                                       if (sflags & F_DELETED) {
-                                               if (!(sflags & F_FLAGGED))
-                                                       aflags &= ~F_DELETED;
-                                       } else
-                                               unex = 1;
+                                       if ((aflags & ~F_DELETED) || dflags)
+                                               info( "Info: Flags of expired 
message changed in (%d,%d)\n", srec->muid, srec->suid );
+                                       return SYNC_OK;
                                } else {
                                        if ((sflags & F_FLAGGED) && !(sflags & 
F_DELETED)) {
                                                unex = 1;
                                                dflags |= F_DELETED;
+                                       } else
+                                               return SYNC_OK;
                                        }
                                }
-                       }
-                       rflags = (*nflags | aflags) & ~dflags;
-                       if ((tops & OP_EXPUNGE) && (rflags & F_DELETED) &&
+                       if ((tops & OP_EXPUNGE) && (sflags & F_DELETED) &&
                            (!tctx->conf->trash || tctx->conf->trash_only_new))
                        {
@@ -357,5 +355,5 @@ sync_old( int tops, store_t *sctx, store
                        default: /* ok */ break;
                        case DRV_OK:
-                               *nflags = rflags;
+                               *nflags = (*nflags | aflags) & ~dflags;
                                if (unex) {
                                        debug( "unexpiring pair(%d,%d)\n", 
srec->muid, srec->suid );




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to