<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Hi,</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Sorry, just read your email again and I realize your problem is different to mine.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><ul><li>Yours is that everything should be moved back to the default storage but nothing<br></li><li>Mine is that some of them should be moved back but everything<br></li></ul></div><div class="gmail_default" style="font-family:verdana,sans-serif">Does "-Dv" give you any hint?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 21 Mar 2023 at 08:45, Duc Anh Do <<a href="mailto:doducanh2710@gmail.com">doducanh2710@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Hi,</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Your problem might be similar to mine a long time ago. IMO behavior of "doveadm altmove -r" command with mdbox format is different to sdbox format:<br><ul><li>With sdbox format, when you move back a message to primary storage (aka default storage), only the message and the file containing it are affected. There is nothing impacted.</li><li>With mdbox format, a file in storage contains multiple messages. When a message is moved back to primary storage, other messages in the same file storage will go with it. The whole file is moved as well.</li></ul></div><div class="gmail_default" style="font-family:verdana,sans-serif">My workaround for this case is: In the mdbox_altmove_add_files function, after defining action for the message which is marked as MOVE_FROM_ALT, we will continue checking other messages in the file storage. If they are not listed in altmoves (they stay in alternate storage), their action will be MDBOX_MSG_ACTION_MOVE_TO_ALT. That means they will be moved 2 times: to primary storage as usual then to alternate storage again to ensure finally they are in alternate storage.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><ul><li>Pros:</li><ul><li>Simple</li><li>Do not impact other parts</li><li>Do not require to update other processes to perform MOVE_FROM_ALT messages</li></ul><li>Cons:</li><ul><li>Reduce performance when number of messages is big</li><li>Increase file storage counter</li><li>If you don't mind building Dovecot from source, give my patch a look.</li></ul></ul></div><div class="gmail_default" style="font-family:verdana,sans-serif">If you don't mind building Dovecot from source, give my patch a look.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 21 Mar 2023 at 05:26, Benoit Branciard <<a href="mailto:Benoit.Branciard@univ-paris1.fr" target="_blank">Benoit.Branciard@univ-paris1.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I have some trouble using "doveadm altmove -r".<br>
<br>
Regular "doveadm altmove" is OK, selected mails were moved to alternate <br>
storage as expected. But I can't manage to get them back to original <br>
location, "doveadm altmove -r" has no effect.<br>
<br>
We are using Dovecot 2.3.4 (Debian Buster package).<br>
<br>
mail_location = mdbox:~/mdbox:DIRNAME=_@@_dbox-Mails_@@_:ALT=/slow%h/mdbox<br>
<br>
doveadm altmove -u myuser since 90d<br>
<br>
-> some message files are created under /slow/my/homedir/mdbox/storage<br>
<br>
doveadm altmove -r -u myuser all<br>
<br>
-> message files are still sitting under /slow/my/homedir/mdbox/storage, <br>
none were created into /my/homedir/mdbox/storage.<br>
<br>
Is there some known issues with doveadm altmove in this version ? Or am <br>
I missing something ?<br>
<br>
I can share more config details if needed.<br>
<br>
-- <br>
Benoit BRANCIARD<br>
Université Paris 1 Panthéon-Sorbonne - DSIUN-SIS<br>
B405 - Centre PMF - 90 rue de Tolbiac - 75013 Paris<br>
Tel. 01 44 07 89 68<br>
<a href="http://dsiun.univ-paris1.fr" rel="noreferrer" target="_blank">http://dsiun.univ-paris1.fr</a><br>
</blockquote></div>
</blockquote></div>