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.Autoresponders
Ever want to send a canned reply to people who email you? For example, you can have email sent to info@widgets-r-us.com 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: info@widgets-r-us.com (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 sales@widgets-r-us.com for a human response. greenery@widgets-r-us.com - information on our "growable" widgets games@widgets-r-us.com - information on our "playable" widgets clothing@widgets-r-us.com - information on our "wearable" widgets promo@widgets-r-us.com - 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, IncorporatedNow, any email sent to greenery@widgets-r-us.com, will be met with an automated reply on the wonders of growable widgets, etc.
Redirection
Redirection allows you to selectively forward email addressed to specific users. For example, all email addressed to sales@widgets-r-us.com may be forwarded to xyz123@aol.com, and all email addressed to bob@widgets-r-us.com may be forwarded to bob8374@hotmail.com. 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, management@widgets-r-us.com might get forwarded to both xyz123@aol.com and tommy4857@mail.com. 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:
/home/francis/.redirect
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|bob8374@hotmail.com tom|tommy4857@mail.com management|bob8374@hotmail.com,tommy4857@mail.com sales|francis,xyz123@aol.com urgent|bob8374@hotmail.com,/home/francis/txt/urgent.txt tony|/dev/null funky*|bob8374@hotmail.com chris|/dev/bounce kilroy|/dev/bounce,francis program|/home/francis/bin/sendreplyDefault Redirection
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 info@widgets-r-us.com 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 bob@widgets-r-us.com will be forwarded to bob8374@hotmail.com. Any email addressed to tom@widgets-r-us.com will be forwarded to tommy4857@mail.com.
Multiple Redirection
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 management@widgets-r-us.com will be sent to both bob8374@hotmail.com and tommy4857@mail.com. Any email addressed to sales@widgets-r-us.com will be forwarded to xyz123@aol.com, with a copy kept on the local server. Any email addressed to urgent@widgets-r-us.com will be forwarded to bob8374@hotmail.com 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 tony@widgets-r-us.com 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.
Wildcards Anyone?
In the "funky*" example, any email addressed to a user beginning with "funky", such as funky007 or funkymonkey is delivered to bob8374@hotmail.com. 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 chris@widgets-r-us.com 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 bogus@seagull.net. To try out autoresponders, send a message to infowidgets@seagull.net.
That's it. Now, you're off and running with autoresponders and redirection!