-
-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--dry-run modifies state, changes behavior of next execution (changes "remote delete" operation into "copy from remote"). #370
Comments
I'm aware of --dry-run can drive you nuts · Issue #52 · OfflineIMAP/offlineimap which is a different issue. In that issue, offlineimap was never without Also, I upgraded from offlineimap version 6.3.4 shipped with Debian precisely because that release does not feature a Thank you for your attention. |
Github-fix: OfflineIMAP#370 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Could you please test above version? |
Tried commit 25c82fd . Summary: does not fix problem. Running several dry runs in a row has correct behavior, fixes "Alternative way to showcase error".
Running a normal run after that still copies mails from remote server, so "Steps to reproduce the error" still reproduce the error.
|
How do you move the mails out? Is the maildir directory removed? Please, read http://www.offlineimap.org/doc/FAQ.html#may-i-delete-local-folders. I wonder you did not notice this change coming with the v7.0.0 series.
|
This makes dry-run consitent when called more than once. Github-ref: #370 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
I had read that before and it's not that case.
No, no maildir directory is removed. The files are just moved from one Since everything works just fine when not doing a dry run, there should be no gotcha specific to IMAP server used or whatever. Have you tried to reproduce the steps are reported? Do you want me to perform a diff of |
I assume you meant "is NOT removed".
Ok. So, another change is likely made into the local cache while it should not.
No. I'm relying on your reports that are quite good, BTW.
That would be wonderful to find the offending code. |
Here you are. The dry run showed this:
The dry run changed only one file: the sqlite database of changed folder:
Hope this helps. |
Did you got those results with the patched offlineimap? |
Good question! I had fetched the correct commit from nicolas33 repo but not checked out.
This line
becomes
I also tested several dry runs in a row and it was also consistent (the log wasn't exactly the same, I guess because of non-deterministic thread execution order, but the simulated commands were the same). Summary: behavior observed here with 25c82fd is correct with our test scenario. Should I continue to use that commit from now on, or do you recommend something else (like switching to a release, backporting that patch alone, whatever)? Thank you for your attention. |
I won't backport the patch because it's not so critical. |
General informations
offlineimap -V
): installed as user from git tag 7.0.4, says: "offlineimap v7.0.4, imaplib2 v2.55 (bundled)"Configuration file offlineimaprc
pythonfile (if any)
Logs, error
Offlineimap reproducibly copies messages that were successfully synced then deleted on destination.
With a dry-run this is correct:
After a dry-run this is incorrect:
Overall approach
The goal is to safely lighten a remote IMAP box.
The approach is to reliably sync two ways remote IMAP with local Maildir, then in local Maildir move selected messages out of the synced area so that they get deleted on remote server.
Sanity checks performed
Setup above configures so that remote IMAP tree gets synced to subdir
sg_ff
in local tree.Things work well.
Checked addition and removal of one mail, flag propagation, etc.
Checked with --info for correct mappings, they are correct.
Steps to reproduce the error
-run offlineimap to get everything in sync.
-move some mail out of
sg_ff
to somearchive
(that offlineimap does not process thanks to folderfilter).-perform
offlineimap --dry-run
as a sanity check. Output is correct (see above[DRYRUN] Deleting 1707 messages
)-perform
offlineimap
to get the 1707 correctly deleted on remote server. Output and action are wrong: (see above[Copy message UID 7536 (1/1707)
)Steps to get correct behavior
Actually tested: repeat steps above, but don't run the
--dry-run
, only the real run.Behavior is then correct.
Alternative way to showcase error
Run with
--dry-run
not once but twice: second result is not same as first.Whatever the configuration, etc, running the same command with
--dry-run
twice in a row (assuming no local or remote activity) should always yield the same result, right? That's the point of a dry run. Observed result means that--dry-run
actually changes offlineimap's internal state.Thank you for your attention.
The text was updated successfully, but these errors were encountered: