Deleting Spam email on a *nix-based hosting server.
Recently I’ve been getting a couple of thousand spam messages in my inbox every day (mostly delivery failures for spam not-from-me). Rather than pull them all the way down to my laptop to delete them, I’m deleting them using Pine after ssh’ing into my hosting account. I’ve found a quick way to delete all messages in the INBOX almost automatically, rather than tagging the messages for deletion individualy.
Here’s what to do:
- Enable aggregate command sets in Pine - go to Setup (’S') -> Config (’C') and tick the box for
enable-aggregate-command-set. - Exit Setup (’E')
- Open the folder list (’L') and open a folder e.g. INBOX.
- Hit ‘;’ and you should see “SELECT CRITERIA :” in the status bar.
- Hit ‘A’ to select all messages. The status bar should change to something like “[All XXX messages selected] and you should see an ‘X’ at the start of each entry in the message list.
- Hit ‘A’ and you should see “APPLY COMMAND :” in the status bar.
- Hit ‘D’ to Delete selected messages
- Hit ‘X’ to Expunge the deleted messages
Or you could just edit the /var/spool/mail/<USER_NAME> file and delete everything in it using your favourite editor, as I subsequently remembered…


