Thanks for asking -- I discovered looking into this that I had over 500K emails in my admin Inbox...
You can delete the extra emails from the command line.
These commands will completely empty the Inbox for admin:
find /home/e-smith/Maildir/cur -name "*$(config get SystemName)*" -exec 'rm' "{}" \;
find /home/e-smith/Maildir/new -name "*$(config get SystemName)*" -exec 'rm' "{}" \;
Notes:
* /home/e-smith/Maildir - admin's mail folder
* /home/e-smith/Maildir/new - new messages - never touched by an email client
* /home/e-smith/maildir/cur - messages that have been accessed by an email client (whether "read" or "unread")
* $(config get SystemName) - get the config variable "SystemName". SME includes this value in the name of each message filename by default. You could probably replace
-name "*$(config get SystemName)*" with
-type f, but I did my testing using the commands shown.
If you want to delete only the emails related to the mail loop (or whatever), find some text specific to the unwanted messages, modify the "find" command, and feed the output to "xargs rm":
In this example, I want to remove only the emails containing the string "MaxHwTemp":
find /home/e-smith/Maildir/cur -name "*$(config get SystemName)*" -exec grep -l "MaxHwTemp" "{}" \; |xargs rm
find /home/e-smith/Maildir/cur -name "*$(config get SystemName)*" -exec grep -l "MaxHwTemp" "{}" \; |xargs rm
If you want to avoid slowing your server down while the cleanup is running, put "nice" at the start of each command line:
nice find /home/e-smith/Maildir/cur -name "*$(config get SystemName)*" -exec 'rm' "{}" \;
nice find /home/e-smith/Maildir/new -name "*$(config get SystemName)*" -exec 'rm' "{}" \;
Be patient.
My server (ARM processor, spinning HDD) was deleting messages at a rate of 25 - 55 per second without "nice" and (unexpectedly) closer to 80 per second with "nice". 500K messages will take over 5 hours to clean up at 25/second, or 1.5 hrs at 80/sec
There is no output from the running command. Consequently, the workstation you're using could go to sleep and disconnect the session unexpectedly. To avoid this, run the commands from the console, or from a desktop that does not go to sleep, or use "screen" so you can start it up and disconnect until it's done.
https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/[edit]fix time estimate for 25 messages per sec