Plumbing 101

by Ed Sawicki
Accelerated Learning Center
Tailored Computers

June 6, 2002

A few weeks ago, the software that sends out the PANUG/BizNix email broadcasts was being worked on to accomodate the fact that we now have mirrored sites. Either site can fail and you'll still reach the PANUG or BizNix web sites and email. The problem was that our mailing list software was not designed to work in a mirrored environment. A temporary setup to allow that day's broadcast to go out allowed someone to send a virus-infected message to the entire list.

I'm responsible for the software and this convinced me to divorce the software that sends the broadcasts from the software that receives mail. I wanted no possibility for received mail to cause mail to be sent to the PANUG/BizNix list. Simplicity and security were my most important goals. This article details how this was achieved.

The core piece of new software is the Mail::Bulkmail Perl module. This takes care of the actual sending of mail to the list. You just point to a flat file that has the list (one email address per line), a file that contains the mail content, and supply a Subject: line. It does the rest. Everything else that needs to be done to build a workable system for sending email broadcasts is just plumbing.

The software is FAST. The bulk of all email is delivered in under one minute. Stragglers are the result of (your) DNS problems and (your) busy mail servers. Since the software is based on Perl, it can run on any platform. I, of course, use Linux but it could work on Windows or NetWare as well. This is the benefit of using software that's not tied to a single platform.

Good system administrators try to automate their tasks so they can take a day off now and then. So, I configured the system to automatically do a broadcast whenever a message file was placed in a certain directory. The message is automatically archived and removed from the directory after the broadcast. This automation is easily achieved with a Linux cron job. Newer versions of Windows and NetWare have scheduling features as well. Since we have mirrored sites, either server can do the broadcast.

Maintenance of the mailing list is currently handled manually but will be handled by a web page in the future. Since simplicity is a goal, I'll not attempt to make that software "smart" and, for example, check to see whether someone is already subscribed. We have mirrored sites that would make foolproof operation difficult (and impossible if a WAN link fails). Both sites will update their own list with a periodic synchronization between the two that sorts the list and weeds out duplicates using standard Unix tools (sort, uniq, etc.).

This project is rather simple. The major piece of code was already available (for free) and I just engineered the plumbing around it. I find that it takes far less time to engineer my own solutions with common tools (perl, cron, shell scripts, etc.) than to search for canned software that comes close to what I want to do but ultimately forces me to settle for functionality and operation that is not ideal for my purposes.

Back