All of our accounts include the ability to use autoresponders and email redirection. Autoresponders allow you to create an auto response to specific email addresses, and redirection allows you to have email that is sent to specific usernames automatically forwarded to other email addresses. You can even pass email messages to a script or program for further processing.
Ever want to send a canned reply to people who email you? For example, you can have email sent to [email protected] send out a canned reply, telling potential customers all about your company and the services you offer. Maybe your reply might look something like this:
From: [email protected] (Autoresponse Bot) Subject: Your Inquiry Thank you for your interest in Widgets, Incorporated. We manufacture high quality widgets in 31 different colors and 6 different sizes. We can also customize your widgets, personalize them with a logo of your choice, or even drop ship them directly to your customers. Widgets are our business! If you would like more information, please send email to one of the corresponding email addresses, or you can always email [email protected] for a human response. [email protected] - information on our "growable" widgets [email protected] - information on our "playable" widgets [email protected] - information on our "wearable" widgets [email protected] - information on our current promotions Thank you again for your interest in our widgets. We hope that we are able to answers all of your questions. Best Regards, Widgets, Incorporated
Now, any email sent to [email protected], will be met with an automated reply on the wonders of growable widgets, etc.
Redirection allows you to selectively forward email addressed to specific users. For example, all email addressed to [email protected] may be forwarded to [email protected], and all email addressed to [email protected] may be forwarded to [email protected] You may also set up a default "catch-all" setting, so that everything that is not specifically being forwarded will either be kept on our mail server or forwarded to an outside email address. You can also have email for a specific username be forwarded to multiple recipients. For example, [email protected] might get forwarded to both [email protected] and [email protected] Finally, you can direct email to a script or program for further processing.
Setting it up
To start using autoresponders and redirection, all you need a .redirect file in your home directory. If you create this file on your local computer and upload it using ftp, it will go into the / directory. If you edit it while connected to your account via telnet, it will go into your home directory. For example, if your username is francis, it will go into /home/francis, and will appear as:
The .redirect file has the following syntax:
username|file or destination
Here is an example .redirect file:
default|francis info|/home/francis/txt/info.txt greenery|/home/francis/txt/greenery.txt games|/home/francis/txt/games.txt clothing|/home/francis/txt/clothing.txt promo|/home/francis/txt/promo.txt bob|[email protected] tom|[email protected] management|[email protected],[email protected] sales|francis,[email protected] urgent|[email protected],/home/francis/txt/urgent.txt tony|/dev/null funky*|[email protected] chris|/dev/bounce kilroy|/dev/bounce,francis program|/home/francis/bin/sendreply
Let's assume that the domain name is widgets-r-us.com. The "default" username is the catch-all. Any email that isn't specifically addressed to usernames handled in other lines is sent to this destination. In the example, they are kept on the local mail server and may be retrieved with a mail client configured with the local server's information.
Redirection to an Autoresponder
Any email addressed to [email protected] will be sent a reply using the text found in the /home/francis/txt/info.txt file, likewise for email addressed to greenery, games, clothing, and promo.
Important Note: In the text files you send as autoresponses, you should include From and Subject header lines at the beginning of the text file, so that the mail message that is sent out has a proper subject and from line. See the example response file above for an idea of how to format one.
Redirection to another Email Address
In simple cases, there will be a one-to-one redirection, where the mail for a specific user will be directed to another email account. In the example above, any email addressed to [email protected] will be forwarded to [email protected] Any email addressed to [email protected] will be forwarded to [email protected]
In some cases, you might want a one-to-many redirection, where the mail for a specific user will be directed to more than one destination. In the example above, any email addressed to [email protected] will be sent to both [email protected] and [email protected] Any email addressed to [email protected] will be forwarded to [email protected], with a copy kept on the local server. Any email addressed to [email protected] will be forwarded to [email protected] and sent a reply using the text found in the /home/francis/txt/urgent.txt file.
Discarding Email Sent to a Specific Username
In the "tony" example, any email addressed to [email protected] is simply discarded. Maybe Tony no longer works for you, or maybe you never had a Tony working for you, but you started getting all this junk email and just want it to go away. That's what the /dev/null delivery option let's you do. Of course, the sender won't know that the messages aren't being delivered, so in many instances, it might be better to have the message bounce back to the sender, as explained in the next paragraph.
In the "funky*" example, any email addressed to a user beginning with "funky", such as funky007 or funkymonkey is delivered to [email protected] By adding the * to the end of the username, you've enabled a wildcard, which can be extremely useful if you want multiple similar addresses to all go to the same place.
Bouncing Email Back to the Sender
In the "chris" example, any email addressed to [email protected] is bounced to the sender. This is useful in situations where simply discarding the message won't work, because the sender will keep assuming that messages are being delivered successfully.
In the "kilroy" example, even though the mail gets bounced, a copy of it is kept for francis. This is helpful in situations where you want the sender to know mail is bouncing, but you want to know what mail they are sending.
Redirection to a Script or Program
In some cases, you might want to have email go to a script or program for further processing. For example, you might have all email addressed to "program" redirected to a script called "sendreply", which will send a reply based on the contents of the email message. This mechanism is not for the faint of heart, but if it is something you need, it is certainly available. The following arguments are passed to the script or program:
from - the email address of the sender
user - the user to which the email was sent
host - the hostname to which the email was sent
Giving it a Go
To see how bounces work, try sending an email message to [email protected]. To try out autoresponders, send a message to [email protected].
That's it. Now, you're off and running with autoresponders and redirection!