On Mon, Nov 6, 2023 at 6:36 PM <[email protected]> wrote: > > Hello, > > There is a very old server running a very old courier-imap: > > Courier-IMAP 4.10.0/i386-portbld-freebsd8.1/Sun Feb 5 20:50:23 PST 2012 > > Recently, an account on this server attempted to delete ~120GB of mail > piled up in the inbox via an iPhone mail client. > > This resulted in a massive copy of data to a .Deleted\ Messages/ maildir > directory. > > As this proceeded to use all free disk space, the IMAP server was shutdown > to prevent system crash. > > Now, there is a lot of mail stuck in the .Deleted\ Messages/tmp/ directory: > > No, the account on this server did not attempt to delete anything.
The "iPhone mail client" issued an IMAP COPY command to copy a large number of messages from some folder, probably INBOX, into a different folder called "Deleted Messages". There's nothing particularly special about an IMAP folder called "Deleted Messages". Apparently, the "iPhone mail client" creates this folder to represent messages that are pseudo-deleted. Presumably, after some period of time, the "iPhone mail client" will quietly delete, actually delete, the individual messages after they've been sitting in this pseudo-"Deleted Messages" folder. First I tried to rm this directory and restart sourier-imap, but the next > time the acct client connects, it begins filling this directory again. > When an IMAP client issues a COPY command to copy a large number of messages into a different folder they get copied into a tmp subdirectory first. After all messages are copied there they get moved into the new or the cur directory, together. It looks like the large number of messages that the "iPhone mail client" is apparently trying to copy, at the same time, is blowing up your storage. The operation fails, and the "iPhone mail client" receives an appropriate error. Which causes it to simply try again at the next opportunity. I also tried to delete this with a python imaplib script, but the mail in > the tmp/ dir is not recognized by imaplib. > > Is there some courier-imap admin utility that can clear/expunge this tmp/ > dir? > There is no "admin utility" of any kind. All operations on IMAP folders can be carried out manually using regular commands, like "mv" or "rm". Courier-IMAP will update its own files to reflect the changes to the actual folders. > Is there any method short of deleting the acct and starting over that will > cause these messages to be purged from the tmp/ directory to cur/ where > they could be deleted and expunged? > Purging messages from the tmp/ directory, in this case, will accomplish absolutely nothing, whatsoever. Deleting messages will have no effect on the "iPhone mail client". It will continue, apparently, trying to copy a large number of messages from one folder to another. > > I'm about to shut down courier-imap again, since the free disk space is > about to be depleted. > > What you need to do is determine which messages are being copied into the "Deleted Messages" folder, which folder they're coming from, and which messages they are. Having done so, just "rm" the messages in their original folder. Hopefully, the "iPhone mail client" will see that the messages that it's attempting to pseudo-deleted don't exist any more, the next time it connects to the IMAP server, and it will then do nothing. When the dust settles you should look into implementing quotas.
_______________________________________________ Courier-imap mailing list [email protected] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap
