From 8c0f59f3f3add18a9ee8be767f54f43996ddbd78 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 20 Jan 2019 20:16:53 +0100 Subject: [PATCH] Note on migrations. --- README | 2 +- interimap | 4 ++++ interimap.md | 4 +++- pullimap | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README b/README index 70bf1df..cb34ef1 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ InterIMAP is a fast bidirectional synchronization program for QRESYNC-capable IMAP4rev1 servers. PullIMAP retrieves messages a remote IMAP mailbox and -deliver them to a SMTP session. Consult the manuals for more information. +deliver them to an SMTP session. Consult the manuals for more information. https://guilhem.org/man/interimap.1.html https://guilhem.org/man/pullimap.1.html diff --git a/interimap b/interimap index 41a0cb9..0fb6c1c 100755 --- a/interimap +++ b/interimap @@ -162,6 +162,10 @@ $DBH->do('PRAGMA foreign_keys = ON'); # also, lUID < local.UIDNEXT and rUID < remote.UIDNEXT (except for interrupted syncs) # mapping.idx must be found among local.idx (and remote.idx) ], + + # We have no version number in the schema, but if we ever need a + # migration, we'll add a new table, and assume version 1.0 if + # the table is missing. ); # Invariants: diff --git a/interimap.md b/interimap.md index ca83dba..1831d39 100644 --- a/interimap.md +++ b/interimap.md @@ -398,7 +398,9 @@ Known bugs and limitations * Using `interimap` on two identical servers with a non-existent or empty *database* will duplicate each message due to the absence of - local ↔ remote UID association. + local ↔ remote UID association. Hence one needs to manually empty + the mail store on one end when migrating to `interimap` from another + synchronisation solution. * `interimap` is single threaded and doesn't use IMAP command pipelining. Synchronization could be boosted up by sending diff --git a/pullimap b/pullimap index e044df5..bd9b1cf 100755 --- a/pullimap +++ b/pullimap @@ -88,6 +88,11 @@ do { fcntl($STATE, F_SETLK, $struct_flock) or die "Can't lock $statefile: $!"; my $flags = fcntl($STATE, F_GETFD, 0) or die "fcntl F_GETFD: $!"; fcntl($STATE, F_SETFD, $flags | FD_CLOEXEC) or die "fcntl F_SETFD: $!"; + + # We have no version number in the statefile, but if we ever need a + # migration, we'll add a 1-byte header for the version number, and + # assume version 1.0 if the size of the file is a multiple of 4 + # bytes. (We can also use the fact that bytes 5 to 8 are never all 0.) }; -- 2.39.2