Reality Bytes: DlistsFebruary 18, 2002Last time, I explained how to sort email and block spam; now I'm going to describe how to send it. Well not quite, I'm sure you don't send spam. But perhaps you have lots of friends whom you like to email, or you need to email members of an organization. Although you could just list all the email addresses in the "To" field of your email, a page of email addresses at the beginning of a message is unsightly and inelegant. It's almost like one of those AOL spam mail forwards that have ten pages of email headers at the top. There are two simple options for sending email to large groups of people: distributions lists (dlists) and the Unix massmail tool. Dlists are commonly used by campus organizations, academic advisors, and anyone else who wants a quick way to email a large group of people without filling the email with a long list of addresses. To set up a dlist, you first need to create a file listing all of the email addresses for the list. The file should follow the following format, which can also be copied from other people’s dlist files as a starting point: Distribution-errors-to: youraddress@andrew.cmu.edu Distribution-content: address1, address2, ... The email addresses can be listed as a full email address, or just as the person's Andrew user name. You can name your dlist file with a ".dl" extension and save it to your Andrew public directory. To send email to the dlist, you use an address such as the following in the "To" field of your email: +dist+~your_userid/public/dlist_name.dl@andrew.cmu.edu It should be noted that the software which handles the dlists apparently filters out duplicate entries. So don't worry if you put your address at the beginning and end of the dlist but only receive the first email. Dlists are simple and convenient, but if you want more sophisticated mailing capabilities, you need to delve into the far less commonly traveled world of the Unix massmail program. This is the program that is used for the CampusXpress emails and campus-wide emails from enrollment officials. It's simply a Perl script on the campus computers that can be used to send an individual email to a list of people - in other words, it will appear as if you sent the email individually to each person. To make matters even better, it has a simple mail merge capability that allows you to include fields in your email that are replaced with the corresponding field for each person in your list. This allows for many possibilities – for example, using the mail merge feature, each of the outgoing emails can be printed with the recipient’s name at the top. To use massmail, you first need to make a file listing each person's email address on a separate line (no commas). If you'd like to use the mail merge feature, you also place a tab after each address and then type the entry for the first field. Make sure you use a tab (only one) and do not use spaces in place of a tab. Also, you can use Andrew IDs in place of full addresses, but then your emails will be addressed to userid@po7.andrew.cmu.edu where the 7 may be a different number depending on the case. The next step is to write your email and save it to a file. If you are planning to use mail merge, you need to place keys in the email text - "@#1" will be replaced by the first field, "@#2" will be replaced by the second, and so on. For example, if you want to send an email to Joe User and Cary A. Card (I've seen that guy's face all over campus, mostly in The HUB though), you could make a user file as such: ju33@andrew.cmu.edu Joe User and in your email file you could start out with: Hi @#1 @#2, which would translate to "Hi Joe User," in Joe's email and "Hi Cary Card," in the other email. Finally, to send your mass mail, you type in: massmail userlist "Hi" body.txt where "userlist" is the name of your mailing list file, "Hi" is your subject line, and "body.txt" is the name of the file containing your message. Note that if you do not have "/usr/local/bin" in your path, you should use the absolute address to massmail, which is /usr/local/bin/massmail. You can type "massmail" at the command prompt to get a description of the program’s syntax. As usual with things like this, it's a good idea to test out your dlist or massmail files using only your own addresses first. And now that you have an arsenal of emailing tools at your disposal, you should remember not to use any of these tools for spam, lest the recipient place you on his or her Sieve reject list. |