Duplication caused by running offlineimap on multiple hosts

Adam Porter adam at alphapapa.net
Mon Dec 17 15:23:03 GMT 2012


On Fri, Dec 14, 2012 at 11:42 AM, Cam Macdonell <cam.macdonell at gmail.com> wrote:
> Ryan Kavanagh <rak <at> debian.org> writes:
>
>>
>> Hi,
>>
>> I'm following up here after having originally asked in the IRC channel.
>>
>> I run offlineimap on my laptop and home server/desktop to retrieve mail
>> from a variety of servers (GMail, universities, etc.). To simplify my
>> explanation, we'll assume that I'm only syncing mail from one server, S.
>>
>> What happens is that when I delete mail in folder F on my laptop, it
>> reappears in F shortly thereafter. Similarly when I delete mail on my
>> server. What I believe is happening is:
>>
>>  1) I delete a message M from F on my laptop
>>  2) offlineimap on my laptop deletes it from S
>>  3) offlineimap on my desktop sees M in it's local copy of F, but
>>     doesn't see it in F on S, and so thinks it's new mail that should be
>
>>  7) M has reappeared in F on my laptop.
>
> <snip>
>
>>
>> Any ideas on what could be causing the above issue?
>
> Was this email ever answered?  I'm experiencing the same issue when having
> two machines autorefresh every 5 minutes.  Is there a solution or is just
> not advisable to use offlineimap with multiple local copies?

I am no expert, but as far as I understand it, this is exactly the
kind of setup that offlineimap is supposed to work correctly in.  Your
desktop should recognize that M was deleted from S and then delete it
locally.

I wonder if it could somehow be a race condition.  I'd suggest trying
a sync schedule something like this:

*:00  Sync laptop
*:15  Sync desktop
*:30  Sync laptop
...

Meaning every hour, at those minutes past the hour.  This way, the two
systems would take turns syncing every 15 minutes, and assuming no
sync took longer than 15 minutes, they should never be syncing at the
same time.




More information about the OfflineIMAP-project mailing list