Chapter 10. POP Goes the E-Mail

My introduction to network scripting came in September 2003, when the SWEN virus started flooding mailboxes with large files purporting to be a "Cumulative Patch" for Windows operating systems. Frequent posters to Usenet newsgroups were receiving thousands of these 150-kilobyte messages every day. As I am a frequent poster, I needed a utility to filter those messages at the source: a POP3 server at my Internet provider.

None of the filters available at the time did an adequate job, so I learned how to do it with shell scripts from Ken Burtch's book Linux Shell Scripting with Bash (Sams, 2004). The book doesn't mention POP3, but the technique of connecting to a network socket is the same for all protocols: bash treats ...

Get Shell Scripting Recipes: A Problem-Solution Approach now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.