How Auto-Responders Work
How Auto-Responders Work
How Auto-Responders Work
Reduced to one sentence: An auto-responder accepts an
email, extracts the sender's address, and returns a
response.
When you send an email to an autoresponder, this is what happens:
- You send an email to a special address.
- Your email gets relayed to the auto-responder
program.
- 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.
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
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 for your use.
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).
Example: goodstuff
/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:
- The location of your sendmail.
- Whether or not you want a copy each email that
Master Auto-Responder receives for processing.
- The name of the plain text file to send as the
response.
- The "From:" and "Subject:" lines for the outgoing
emails.
- Whether the outgoing email is HTML or plain text.
Will Bontrager
©2001 Bontrager Connection, LLC
Please note:
Articles on this website are presented "as is". However -
If you have a question about a CGI script, HTML, CSS, PHP, or JavaScript
Ask one of our Experts and you'll have your answer!
Click here for details.