I have migrated beginning this year from mbox to mdbox, but I am still struggling with the concept of refcount=0 and where these message stay.
This is my test mailbox (shell script uses 'doveadm mailbox status -u')
[@ sbin]# mailbox-ls.sh testtest size listing mailboxes of testtest: Archive msgs=0 vsize=0B Archive/2011 msgs=0 vsize=0B Archive/2012 msgs=0 vsize=0B Archive/2013 msgs=0 vsize=0B Archive/2014 msgs=0 vsize=0B Archive/2015 msgs=0 vsize=0B Archive/2016 msgs=0 vsize=0B Archive/2017 msgs=0 vsize=0B Archive/2018 msgs=0 vsize=0B Archive/2019 msgs=3435 vsize=277MiB Archive/Archive msgs=1 vsize=2.4KiB Deleted Messages msgs=0 vsize=0B Drafts msgs=4 vsize=1.1KiB INBOX msgs=1329 vsize=211MiB INBOX/test2 msgs=3 vsize=187KiB Junk msgs=2 vsize=2.0KiB Sent msgs=20 vsize=13KiB Trash msgs=47 vsize=752KiB
[@ sbin]# doveadm -o mail_location=mdbox_deleted:/home/popusers/testtest/mdbox:INDEX=/home/popindex/testtest/index mailbox status -u testtest 'messages vsize' '*' Sent messages=0 vsize=0 Drafts messages=0 vsize=0 INBOX/test2 messages=0 vsize=0 Junk messages=0 vsize=0 Deleted Messages messages=0 vsize=0 Trash messages=0 vsize=0 INBOX messages=0 vsize=0
Now I am deleting 1 message from inbox with thunderbird, and I am getting this expected result, 1 message less in inbox, 1 message more in Deleted messages.
[root@mail04 sbin]# mailbox-ls.sh testtest size listing mailboxes of testtest: Archive msgs=0 vsize=0B Archive/2011 msgs=0 vsize=0B Archive/2012 msgs=0 vsize=0B Archive/2013 msgs=0 vsize=0B Archive/2014 msgs=0 vsize=0B Archive/2015 msgs=0 vsize=0B Archive/2016 msgs=0 vsize=0B Archive/2017 msgs=0 vsize=0B Archive/2018 msgs=0 vsize=0B Archive/2019 msgs=3435 vsize=277MiB Archive/Archive msgs=1 vsize=2.4KiB Deleted Messages msgs=1 vsize=433B Drafts msgs=4 vsize=1.1KiB INBOX msgs=1328 vsize=211MiB INBOX/test2 msgs=3 vsize=187KiB Junk msgs=2 vsize=2.0KiB Sent msgs=20 vsize=13KiB Trash msgs=47 vsize=752KiB
[@ sbin]# doveadm -o mail_location=mdbox_deleted:/home/popusers/testtest/mdbox:INDEX=/home/popindex/testtest/index mailbox status -u testtest 'messages vsize' '*' Sent messages=0 vsize=0 Drafts messages=0 vsize=0 INBOX/test2 messages=0 vsize=0 Junk messages=0 vsize=0 Deleted Messages messages=0 vsize=0 Trash messages=0 vsize=0 INBOX messages=0 vsize=0
Now I right click trash in thunderbird and choose empty trash, and I am getting this expected result, Deleted messages is empty. (Notice Trash stays at the same message count)
[@ sbin]# mailbox-ls.sh testtest size listing mailboxes of testtest: Archive msgs=0 vsize=0B Archive/2011 msgs=0 vsize=0B Archive/2012 msgs=0 vsize=0B Archive/2013 msgs=0 vsize=0B Archive/2014 msgs=0 vsize=0B Archive/2015 msgs=0 vsize=0B Archive/2016 msgs=0 vsize=0B Archive/2017 msgs=0 vsize=0B Archive/2018 msgs=0 vsize=0B Archive/2019 msgs=3435 vsize=277MiB Archive/Archive msgs=1 vsize=2.4KiB Deleted Messages msgs=0 vsize=0B Drafts msgs=4 vsize=1.1KiB INBOX msgs=1328 vsize=211MiB INBOX/test2 msgs=3 vsize=187KiB Junk msgs=2 vsize=2.0KiB Sent msgs=20 vsize=13KiB Trash msgs=47 vsize=752KiB
So this message should have refcount=0. But where is it, this still shows 0 messages everywhere?
[@ sbin]# doveadm -o mail_location=mdbox_deleted:/home/popusers/testtest/mdbox:INDEX=/home/popindex/testtest/index mailbox status -u testtest 'messages vsize' '*' Sent messages=0 vsize=0 Drafts messages=0 vsize=0 INBOX/test2 messages=0 vsize=0 Junk messages=0 vsize=0 Deleted Messages messages=0 vsize=0 Trash messages=0 vsize=0 INBOX messages=0 vsize=0