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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.