I guess it serves me right, but I was testing a looping mail script that was designed to send an email to a friend every minute (for a set period of time) just to annoy them. (A reminder for a forgetful person)
I was testing it on myself to see if it would work and in the process set an infinite loop, and emailed myself an unknown number of times. It was on my localhost using MAMP Pro.
The accident looked like this
<?php
while (1){
$to = "[email protected]";
$subject = "The Subject";
$message = "The Reminder.";
$from = "[email protected]";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "The End.";
}
?>
I ran the script and left it in the browser for about 40 seconds while having a mind blank, since then I've received about 800 or more emails in my spam folder before turning off MAMP.
I'm wondering how I can clear the queue that it's made. (While MAMPs off no new spam emails are received, when MAMPs on it starts again)
In terminal sudo postqueue -p
will give me long the list however postfix -f
/ postfix flush
etc produce
postqueue: fatal: Cannot flush mail queue - mail system is down
postsuper -p gives me
postsuper: fatal: use of this command is reserved for the superuser
sudo postsuper -d and one ID will delete a message but I can't delete all.
EDIT/UPDATE
ANSWER:
I should have kept fiddling.
sudo postsuper -d ALL Is the winner resulting in 385 messages deleted
That could have been annoying.
Serves me right for trying to play a practical joke I didn't fully understand.