Solved mail delete messages

Trying to delete some system messages of a script that didn't have permissions. I can't seem to get rid of them using delete *. Is that the right command? It seems that's what's used, but after exiting mail, the messages show up again. It's told me there were no more new messages, but then they aren't deleted.

Had a look at https://www.freebsd.org/cgi/man.cgi?query=mail&sektion=1, where I got the instructions.

Any insight appreciated as to how I work this. Cheers
 
Could they be "stuck" in the queue? If the script went rogue it may have pushed a lot of mails in the queue. So you delete a bunch in the mailbox and a couple of seconds later a whole new batch appears? Those could be the ones that had been waiting in the queue.
 
Are you sure it's still the same message and not a new one?

Normally merely running mail, then using either d or delete should suffice. Also use h to verify after you tried the delete.
 
If you leave mail with x, the messages will be left as they were before calling mail. You must leave with q.

If you want to delete from message 3 to 6, write d3-6 and quit with q. Read messages will be moved to ~/mbox. To reread those you use mail -f mbox.
 
Could they be "stuck" in the queue? If the script went rogue it may have pushed a lot of mails in the queue. So you delete a bunch in the mailbox and a couple of seconds later a whole new batch appears? Those could be the ones that had been waiting in the queue.

Nope. The same 16. The script is set to run at Midnight every night.

So tried d 1-16, then h => No applicable messages

x
mail

=> all 17 messages back again.
 
If you leave mail with x, the messages will be left as they were before calling mail. You must leave with q.

If you want to delete from message 3 to 6, write d3-6 and quit with q. Read messages will be moved to ~/mbox. To reread those you use mail -f mbox.

And THAT worked. Thank you.
 
Back
Top