<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
On 5/26/20 8:33 AM, Brian J. Murrell wrote:<br>
<blockquote type="cite"
cite="mid:7077b241561e36be6f3aa7696ca5d11b0494ef45.camel@interlinx.bc.ca">
<pre class="moz-quote-pre" wrap="">Hi.
Every IMAP client I query my cyrus imapd 2.4.17 server with says I have
~4K messages in my INBOX. However when I do a listing of
/var/spool/imap/b/user/brian/ it shows almost 13K files.
None of these include messages which have been deleted but not
expunged. I manually expunge my mailbox many times per day.
If I'm understanding mbexamine's output correctly, I have files on disk
that are not being displayed by mbexmine. My understanding of
mbexamine's output is that on a line formatted as such:
000001> UID:00089183 INT_DATE:[redacted] SENTDATE:[redacted] SIZE:1537
that the 00089183 is the reference to the file on the spool in
/var/spool/imap/b/user/brian/89183.
Is that correct? If so, I definitely have files on the disk which are
not found in any "000001> UID" line from mbexamine. ~9600 of them.
That seems to make up the difference between what an IMAP client sees
and how many files are on disk.
I also have multiple occurrences of the same "000001> UID:" and where
there are no matching files on the disk. Should that be possible?
So how come the huge discrepancies and how do I reconcile them?
Cheers,
b.</pre>
</blockquote>
<br>
Brian,<br>
In a nutshell, RTFM. Or, read this mailing list, since the answer
to this is literally exactly the same as to the very last question
in this list. It's all about the setting of 'expunge_mode' in
imapd.conf:<br>
<blockquote>
<p><code class="docutils literal"><span class="pre">expunge_mode:</span></code>
delayed</p>
<blockquote>
<div>The mode in which messages (and their corresponding cache
entries)
are expunged. “semidelayed” mode is the old behavior in which
the
message files are purged at the time of the EXPUNGE, but index
and cache records are retained to facilitate QRESYNC.
In “delayed” mode, which is the default since Cyrus 2.5.0,
the message files are also retained, allowing unexpunge to
rescue them. In “immediate” mode, both the message files and
the
index records are removed as soon as possible. In all cases,
nothing will be finally purged until all other processes have
closed the mailbox to ensure they never see data disappear
under
them. In “semidelayed” or “delayed” mode, a later run of
“cyr_expire”
will clean out the retained records (and possibly message
files).
This reduces the amount of I/O that takes place at the time of
EXPUNGE and should result in greater responsiveness for the
client,
especially when expunging a large number of messages.
Allowed values: <em>immediate</em>, <em>semidelayed</em>, <em>delayed</em></div>
</blockquote>
</blockquote>
As shown in this excerpt from <a moz-do-not-send="true"
href="http://www.cyrusimap.org/imap/reference/manpages/configs/imapd.conf.html">the
manpage</a>, the default is now "delayed," since v2.5.0. Those
files on disk are expunged messages which have not yet been
deleted. They may be recovered via the 'unexpunge' command, as
described on <a moz-do-not-send="true"
href="http://www.cyrusimap.org/imap/reference/manpages/systemcommands/unexpunge.html?highlight=unexpunge">its
manpage, here</a>. To see a list of such messages, try 'sudo -u
cyrus -c "unexpunge -l <a class="moz-txt-link-abbreviated" href="mailto:user/username@domain.tld">user/username@domain.tld</a>'<br>
<br>
Cheers,<br>
-nic<br>
<pre class="moz-signature" cols="72">--
Nic Bernstein <a class="moz-txt-link-abbreviated" href="mailto:nic@nicbernstein.com">nic@nicbernstein.com</a>
<a class="moz-txt-link-freetext" href="https://www.nicbernstein.com">https://www.nicbernstein.com</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/nic-b-26577a178/">https://www.linkedin.com/in/nic-b-26577a178/</a>
</pre>
</body>
</html>