As shown below, adding a message to TRASH doesn't increase
virtual/test's MESSAGES count. However SELECTing virtual/test triggers
the increase; so does running doveadm mailbox status vsize virtual/test
in another shell.
$ mkdir -m0700 ~/mail/virtual/test $ echo -e "TRASH\n\tall" > ~/mail/virtual/test/dovecot-virtual
$ /usr/lib/dovecot/imap S: * PREAUTH [CAPABILITY IMAP4rev1 … ] Logged in as guilhem C: a STATUS TRASH (MESSAGES UIDNEXT UNSEEN) C: b STATUS virtual/test (MESSAGES UIDNEXT UNSEEN) S: * STATUS TRASH (MESSAGES 5599 UIDNEXT 5619 UNSEEN 0) S: a OK Status completed (0.001 secs). S: * STATUS virtual/test (MESSAGES 5599 UIDNEXT 5600 UNSEEN 0) S: b OK Status completed (0.032 secs).
C: c APPEND TRASH {1+} S: x S: c OK [APPENDUID 1442277584 5619] Append completed (0.029 secs).
C: d STATUS TRASH (MESSAGES UIDNEXT UNSEEN) C: e STATUS virtual/test (MESSAGES UIDNEXT UNSEEN) S: * STATUS TRASH (MESSAGES 5600 UIDNEXT 5620 UNSEEN 1) S: d OK Status completed (0.000 secs). S: * STATUS virtual/test (MESSAGES 5599 UIDNEXT 5600 UNSEEN 0) S: e OK Status completed (0.000 secs).
# it doesn't help to LOGOUT and issue the STATUS command again. However,
# it does to execute doveadm mailbox status vsize virtual/test
in another
# shell, or to SELECT virtual/test in the IMAP session.
C: f STATUS TRASH (MESSAGES UIDNEXT UNSEEN) C: g STATUS virtual/test (MESSAGES UIDNEXT UNSEEN) S: * STATUS TRASH (MESSAGES 5600 UIDNEXT 5620 UNSEEN 1) S: f OK Status completed (0.000 secs). S: * STATUS virtual/test (MESSAGES 5600 UIDNEXT 5601 UNSEEN 1) S: g OK Status completed (0.000 secs).
Cheers,
Guilhem.