Is atomic MOVING of messages between IMAP folders possible?

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Thu Aug 7 07:25:09 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Quoting Greg Sullivan <greg.sullivan at sullivang.net>:
>
>> I was gobsmacked when I discovered that duplicates could easily occur!

"move" is not atomic in a filesystem either. Under circumstances it has to 
be implemented by "cp && rm". Unless you protect the move's source by 
locking - as Timo suggested with the message at Tue, 5 Aug 2014 21:19:46 - 
the same duplication can occur.

In your reply you've wrote: "Heaven FORBID that I should ask for entire 
conversation moves to be atomic as well. (which is really what I want)" 
Actually you want to use database-like transactions for IMAP commands or 
sessions.

Actually, what should happen _during_ the MOVE, if another client queries 
for the source message or launches commands on it? Now, for a short period 
of time the copy takes the message is available at the source location 
only, then it disappears if the move was successful.
IMHO, you could write a plugin that monitors or wraps "MOVE" commands and 
denies second simultaneous move attempts. In a way, that plugin would do 
the locking Timo suggested as a server-side implementation.
How many simultaneous MOVE do you expect? Maybe you could lock the source 
mailbox wholly during a move.

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBU+Mp13z1H7kL/d9rAQLiAAgAqryldRY7xyLxhULj+nmABbspsXsauip5
KNGYx1lPmTh1JqhvGZ/1mxn80ImidXa2U3poa8ltHPthjHW1NvqsDCMFXTzpUC36
l6zIP7VOEwMSLAq0/KmsbvJIh13h9IiZRzG3zZDO7AaDyxru171qctuEwOKO3EWp
W4kicYne3fAj/FXEI4+Dnm7a6cJabIRL2DTzkU33JC0S+/seq/8ZXj9XO99ocwJV
86xjdtaD90H3akIA1G7/Q1Ielw5tEPGMD7Ye4RF+ra1DYOsj9RYXisVqNhYLDh84
qUsBPXm7Ap4rgp07iar10ex3UYQbGEq0VR9bxUxna4IMS67EtBwLpQ==
=7Rkz
-----END PGP SIGNATURE-----


More information about the dovecot mailing list