R. King Ables
The rts (for Return To Sender) script in Listing 1 responds
much like the Post Office does when it receives mail
with the wrong
name or address: it returns the message to the sender
along with notification
of why it is being returned. You can use this script
in several ways:You can also use rts to tell senders that the
address they've used was not precise enough (e.g., "smith")
and to provide a list of people they might be trying
to reach along
with the appropriate addresses for each. This feature,
a "dummy" alias, could also be used to auto
reply to standard
queries (for example to automatically mail your company's
catalog to anyone requesting it).
We use rts with the sendmail(8) mail transport system
(a mailer originating with BSD and used on Suns and
many other common
platforms). It should be usable with other mailers as
well. If your
mailer system adds header lines or changes the standard
you may need to account for that. In general, you should
alias for any name which is to trigger rts and have
pipe the contents of the mail message into the rts script.
In our /etc/aliases file (for sendmail) we define an
username: "|/usr/local/etc/rts username"
where "username" is the account name to be
In this case, rts is located in /usr/local/etc, but
it should be put wherever your local system administration
When mail for username is received, it will be piped
rts script with username used as the first argument.
rts will generate a return message to the sending user.
return message will include the original message and
informative message for that particular address.
In the case where a user has left, we use a message
of the form:
"As of 01-April-92, Joe User is no longer at XYZ
Widgets, Inc. If you wish to contact him by electronic
mail, you may
reach him at [new e-mail address]. You may also contact
him by phone
at [new phone #]. Your message is being returned to
you by an automatic
process so you may resend it if you wish. No human was
returning your message to you."
These messages are put in /usr/local/lib/rts in
files named for each user for whom you want to provide
the reply service.
You can also use rts to point e-mail correspondents
specific addresses. For example, if your site had several
smith, you could define an alias for "smith"
smith: "|/usr/local/etc/rts smith"
and create a file /usr/local/lib/rts/smith
"You have sent a message to firstname.lastname@example.org.
This is not sufficient to reach anyone here. We are
returning your message to you so you can resend it to
party. Please select an address from the list of possible
Bob Smith bob
Jane Smith jsmith
Janet Smith janet
John Smith jrs
Wanda Smith wanda"
To automatically return an on-line company catalog,
an alias of "catalog" and put the catalog
in the /usr/local/lib/rts/catalog
Using rts, it is possible to help internal as well as
users be sure they send messages to the correct place
the first time,
before sensitive information winds up in the wrong place.
About the Author
King Ables has been a UNIX user since 1980 and has
systems or developing system management and networking
1983. He is currently doing system and network management
for HaL Computer Systems in Austin, TX.