Deleting large number of emails from busy mailbox

Kevin J. McCarthy kevin at 8t8.us
Mon Mar 13 20:07:04 UTC 2023


On Mon, Mar 13, 2023 at 08:47:14AM +0100, Vegard Svanberg wrote:
>Latest mutt on local IMAP (Dovecot).
>
>My mailbox is rather busy (and contains around half a million emails).
>
>Say I want to delete 2000 emails.
>
>I tag them, ;d and press X to expunge. Mutt starts fetching every email
>(not sure why that is - does it have to?), then would normally remove
>them after that.

Do you mean the 2000 emails you want to delete, or the half-million 
emails in the mailbox?

If it's the first, it sounds as if Mutt thinks the value in $trash is 
not the same server as the mailbox you are connected do.  Otherwise it 
would do a UID COPY on the server side, which would be faster.

You can check this by running mutt with '-d 3' and search in the log for 
imap_fast_trash.

If that wasn't intentional, try to see if $trash and the current mailbox 
URL differ somehow and try to make them the exact same.

>Problem is: if a new email arrives during this process (which could take
>a few minutes), Mutt never gets around to actually removing the
>messages. It just seems to abort in the middle of the operation and I
>have to do expunge again until I eventually succeed after a few
>attempts.
>
>Anything I could do my end to solve this?

That's unfortunately an old issue with Mutt's sync design.  It checks 
the mailbox for any reopen/new/flag updates before trying to sync and 
aborts if that's the case.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.mutt.org/pipermail/mutt-users/attachments/20230313/cfbe409a/attachment.asc>


More information about the Mutt-users mailing list