WillMaster Possibillites Logo EzineSeek Award
How Auto-Responders Work
by
William Bontrager

Permission is granted to reprint this article in its entirety, provided no reprints are sent in conjunction with unsolicited bulk email, provided no fee or other value is exchanged, provided no changes are made to the article, and provided the author's name, signature lines, and copyright line are printed with the article; except you may change the article's title.

Reduced to one sentence: An auto-responder accepts an email, extracts the sender's address, and returns a response.

I've set up an autoresponder you can test. An email to MasterAutoResponder@willmaster.com will cause a test email to be sent to you.

So this is what happens:

  1. You send an email to a special address.
  2. Your email gets relayed to the auto-responder program.
  3. The auto-responder accepts your email, extracts your address, and returns a response to you.

In general, auto-responder programs don't care what email address you use for the special address. You decide what address is appropriate.

But auto-responder programs do care that they receive the email addressed to them.

The method I employ to relay email to a Perl program is with sendmail's aliases file. ("aliases" is the name of the file.)

Not all hosting companies give their accounts access to their own aliases file. True UNIX virtual servers do. Many of the cheaper "virtual hosting" solutions do not.

(We use iServer.com's virtual servers. For those of you who have attention on price, I have noticed that virtual servers and "virtual hosting" solutions can be similarly priced.)

Although not the only method, if you have your own sendmail aliases file then I can show you how to set it up to relay email to your auto-responder program.

You can ask your hosting company whether or not you have your own sendmail aliases file. Or, you can look for yourself with FTP, Telnet, or SSH. First, look in the root directory. If the file is not there, check your "etc" and "usr" directories. If you don't have those directories or you don't find the file in those, look in other likely directories.

Download your aliases file with FTP as ASCII/plain text. Do all edits with an ASCII/plain text editor. (See http://MasterCGI.com/faq/ for more info.)

At this point, I'm assuming you have an auto-responder program installed on your server. If not, download a copy of Master Auto-Responder from http://willmaster.com/a/8/pl.pl?prog85 for your use. The current version 1.0 is free. Later versions will probably require purchase.

Decide what email address you will use for your auto-responder program.

Open the "aliases" file with your editor. The line you'll be adding to this file is a little different from the
somename: othername
and
somename: othername@domain.com
lines you see there.

The location of the line you'll be adding doesn't really matter so long as it is somewhere below the
MAILER-DAEMON: ...
and
postmaster: ...
lines.

This is the line to add to your "aliases" file:

responderaddy: "|/path/to/perl /path/to/program.cgi"

Now, replace:

responderaddy
with the front part of the email address for your auto-responder program (the front part being the part before the "@" character).
Examplegoodstuff

/path/to/perl
with the path to perl on your server — the "|" (vertical bar or "pipe") character must remain as the leading character.
Example/usr/bin/perl

/path/to/program.cgi
with the complete server path to and name of your installation of MasterAutoResponder.cgi
Example/usr/local/etc/httpd/MasterAutoResponder.cgi

Replace only what is specified above; keep the colon, vertical bar or "pipe", and quote characters.

The line you just added relays email with the specified address to whatever follows the colon. Because the complete destination contains a space, it is enclosed within quotes.

The first character of the destination is the vertical bar (sometimes called "pipe") character, which tells sendmail to pipe the email straight to whatever follows it.

Incoming sent to the special address is piped to your perl installation, which then launches MasterAutoResponder.cgi (specified in the path following the space) and hands it the email to process.

If you want to add a comment within the aliases file, begin the comment line with the # character.

Upload your modified aliases file with FTP as ASCII/plain text.

The final step is to update sendmail's database with the new information you put into the aliases file. Different servers have different procedures for this.

You'll probably need to telnet or SSH to your account and run a program called "vnewalises" or "newaliases" (without the quotes). (You run the program by typing its name and pressing the Enter key.) When the program runs, it should give you a message about how many aliases your database now has. If you can't figure it out, your hosting company should be able to tell you how to do it.

If you decide to download Master Auto-Responder, installation instructions are within the script. You'll be asked:

  1. The location of your sendmail.
  2. Whether or not you want a copy each email that Master Auto-Responder receives for processing.
  3. The name of the plain text file to send as the response.
  4. The "From:" and "Subject:" lines for the outgoing emails.
  5. Whether the outgoing email is HTML or plain text.

Did you enjoy the article?

Once you get your auto-responder working, you might consider obtaining Master Info Relay. That program will let you put forms on your web pages that trigger your auto-responder when visitors fill in their email address. A link to the program is on the Master Auto-Responder download page.

Copyright 2001 William Bontrager
Programmer/Publisher, "WillMaster Possibilities" ezine
http://willmaster.com/possibilities/
subscribe-possibilities@willmaster.com
Business Home Page: http://willmaster.com/