|
Setting up Autoresponders and Forwarding
There are two programs that handle all the mail for your account, sendmail and procmail. Sendmail is the Mail Transfer Agent and handles all mail processes for the system. Procmail is an add-on program that allows users to participate in the mail process and perform various delivery functions such as responding automatically to the sender. We have prepared a brief overview of the basic process including which directories and files need to be in place in order to establish simple mail forwarding and autoresponders. Please see the procmailMan page for a more detailed explanation.
In order to modify and update your mail forwarding and Autoresponders, you will have to be able to use an FTP program and a text editor (such as Notepad or Wordpad).
In your home directory (i.e. /usr/home/user) there are several files and directories used for mail handling.
The files necessary.
.forward .procmailrc
The directories necessary
.procmail fileserver mail
A brief description of each of the files and directories follows. For all examples we will assume the username is "user", the user's domain is "yourdomain.com", the user's ISP's name is "isp.com" and the autoresponder name is "sample". Examples are indented and in red.
The .forward file
Sendmail looks for this file in the users home directory. If present it executes the commands contained in it. For our system the file looks like the following:
"|exec /usr/local/bin/procmail #user"
Note the the information after the # is your user name. Replace this with your user name. The quotes are necessary and must be included.
The .procmailrc file
VERBOSE=off SENDMAIL=/usr/sbin/sendmail MAILDIR=$HOME/mail PMDIR=$HOME/.procmail DEFAULT=$MAILDIR/procmail LOGFILE=$PMDIR/log FILEDIR=$HOME/fileserver
:0 * ^
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
!
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
#sample autoresponder:0 * ^TOsample *!^FROM_DAEMON *!^X-Loop:
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
{ :0 ic |(formail -r -A "Precedence: junk" \ -I"From: yourdomain.com Auto Responder <
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
> " \ -I"Subject: Sample Autoresponder" \ -A "X-Loop: sample@yourdomain";\ cat $FILEDIR/sample.txt ) |$SENDMAIL -t :0 !
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
}
#catch all the rest and send to default :0 !
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Let's look at a couple of these lines in more detail:
VERBOSE=off
Turn this on to debug your procmail script. Be sure to turn it off to avoid building a very large file.
PMDIR=$HOME/.procmail
The home of procmail in your home directory
DEFAULT=$MAILDIR/procmail
Where to put any mail that you don't specify otherwise. Look here to find any mail, if you have errors in your file.
LOGFILE=$PMDIR/log
This is your log file. Look in it to determine what problems you might be having, or who has requested information
FILEDIR=$HOME/fileserver
This is where you store all your autoresponder text files. The files will become the body of your e-mail autoresponder message.
:0 * ^
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
!
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
This is simple mail forwarder. Any mail sent to
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
will be forwarded to
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
. Copy and paste these lines to add more. Keep in mind procmail processes requests in the order they appear in the file.
#sample autoresponder:0 * ^TOsample *!^FROM_DAEMON *!^X-Loop:
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
{ :0 ic |(formail -r -A "Precedence: junk"\ -I"From: yourdomain.com Auto Responder <
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
> " \ -I"Subject: Sample Autoresponder" \ -A "X-Loop: sample@yourdomain";\ cat $FILEDIR/sample.txt ) |$SENDMAIL -t :0 !
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
}
This is an autoresponder. I like to put a comment line in front of it to help separate the Autoresponders and help readability. Replace the word sample with the name of your autoresponder (which will be the e-mail address as well). Replace yourdomain.com with your domain address. Change the information after From: and before < to the information you want to appear as who the mail came from (keep it simple). Change the information after Subject: and before the " to whatever you want the subject of your e-mail to be (again short and sweet). The sample.txt information is the name of the file you will store in the fileserver directory (I like to use the same name as the autoresponder so that I can easily associate the filenames with the autoresponder). The remainder sends you a copy of the senders mail (i.e. when they request the autoresponder you will get a copy of the request so you know who is requesting information)
#catch all the rest and send to default :0 !
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
This does just what it says. It forwards all mail that doesn't get forwarded or autoresponder on to your ISP mail address. Make sure you don't put anything after this section. Copy and paste the Autoresponders above this point.
NOTES:
When using your FTP program, make sure you set it to transfer in ASCII mode, NOT binary.
Create all your autoresponder text files in the text editor.
After setting up and testing your Autoresponders, all you have to do to update the message is FTP the new text file to the fileserver directory.
Be very careful when editing the .procmailrc file (yes it does have a period in front). Strange and awful things can occur.
Edit your log files and delete old information regularly to avoid building large files. You can Telnet to your domain and type "pine .procmailrc" to open a simple text editor in UNIX (do not enter the quotes).
We will help answer simple questions, but problem resolution and autoresponder setup by us will be billed at our normal rates. If the problem is ours there will obviously be no charge.The files look complicated, but we have done all the hard work for you. Proceed cautiously and you should be fine. Remember the ASCII setting in FTP.
Note the the information after the # is your user name. Replace this with your user name. The quotes are necessary and must be included.
The .procmailrc file
VERBOSE=off SENDMAIL=/usr/sbin/sendmail MAILDIR=$HOME/mail PMDIR=$HOME/.procmail DEFAULT=$MAILDIR/procmail LOGFILE=$PMDIR/log FILEDIR=$HOME/fileserver
:0 * ^
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
!
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
#sample autoresponder:0 * ^TOsample *!^FROM_DAEMON *!^X-Loop:
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
{ :0 ic |(formail -r -A "Precedence: junk" \ -I"From: yourdomain.com Auto Responder <
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
> " \ -I"Subject: Sample Autoresponder" \ -A "X-Loop: sample@yourdomain";\ cat $FILEDIR/sample.txt ) |$SENDMAIL -t :0 !
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
}
#catch all the rest and send to default :0 !
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Let's look at a couple of these lines in more detail:
VERBOSE=off
Turn this on to debug your procmail script. Be sure to turn it off to avoid building a very large file.
PMDIR=$HOME/.procmail
The home of procmail in your home directory
DEFAULT=$MAILDIR/procmail
Where to put any mail that you don't specify otherwise. Look here to find any mail, if you have errors in your file.
LOGFILE=$PMDIR/log
This is your log file. Look in it to determine what problems you might be having, or who has requested information
FILEDIR=$HOME/fileserver
This is where you store all your autoresponder text files. The files will become the body of your e-mail autoresponder message.
:0 * ^
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
!
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
This is simple mail forwarder. Any mail sent to
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
will be forwarded to
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
. Copy and paste these lines to add more. Keep in mind procmail processes requests in the order they appear in the file.
#sample autoresponder:0 * ^TOsample *!^FROM_DAEMON *!^X-Loop:
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
{ :0 ic |(formail -r -A "Precedence: junk"\ -I"From: yourdomain.com Auto Responder <
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
> " \ -I"Subject: Sample Autoresponder" \ -A "X-Loop: sample@yourdomain";\ cat $FILEDIR/sample.txt ) |$SENDMAIL -t :0 !
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
}
This is an autoresponder. I like to put a comment line in front of it to help separate the Autoresponders and help readability. Replace the word sample with the name of your autoresponder (which will be the e-mail address as well). Replace yourdomain.com with your domain address. Change the information after From: and before < to the information you want to appear as who the mail came from (keep it simple). Change the information after Subject: and before the " to whatever you want the subject of your e-mail to be (again short and sweet). The sample.txt information is the name of the file you will store in the fileserver directory (I like to use the same name as the autoresponder so that I can easily associate the filenames with the autoresponder). The remainder sends you a copy of the senders mail (i.e. when they request the autoresponder you will get a copy of the request so you know who is requesting information)
#catch all the rest and send to default :0 !
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
This does just what it says. It forwards all mail that doesn't get forwarded or autoresponder on to your ISP mail address. Make sure you don't put anything after this section. Copy and paste the Autoresponders above this point.
NOTES:
When using your FTP program, make sure you set it to transfer in ASCII mode, NOT binary.
Create all your autoresponder text files in the text editor.
After setting up and testing your Autoresponders, all you have to do to update the message is FTP the new text file to the fileserver directory.
Be very careful when editing the .procmailrc file (yes it does have a period in front). Strange and awful things can occur.
Edit your log files and delete old information regularly to avoid building large files. You can Telnet to your domain and type "pine .procmailrc" to open a simple text editor in UNIX (do not enter the quotes).
We will help answer simple questions, but problem resolution and autoresponder setup by us will be billed at our normal rates. If the problem is ours there will obviously be no charge.The files look complicated, but we have done all the hard work for you. Proceed cautiously and you should be fine. Remember the ASCII setting in FTP.
 |