procmail
[Top] [All Lists]

Re: Autoresponder

1995-12-17 20:56:29
On Sun, 17 Dec 1995, Massimo Fuchs wrote:

1.    Is there a sample/readme.file somewhere which explains how to set-up
procmail as an autoresponder?

A. Set up a user account like "info" or whatever.

B. Add the ".forward" file exactly as it is in the notes section of the 
man page for procmail.  If you have trouble with the "^H" character just 
cut and paste the line from the man page or from this email, leave all 
quotes as they are.

"|IFS=' '&&p=/usr/local/bin/procmail&&test -f $p&&exec $p -Yf-||exit 75 ##info"


C. Add the following file, edited for your system and user name, the file 
needs the name ".procmailrc", make sure the paths in the first five lines 
match your system.  The first recipe is overkill but saves a copy of all 
incoming mail into a folder called backup in the mail directory.  Unless 
you are running BSDI your sendmail will most likely be in a different 
directory.  The file that is sent for the response is info.txt in the 
home directory.  The second recipe is the one that does the responce.  
It will respond even if the subject and body are blank.  You could 
customize it by adding an additional condition line 
"* Subject: <some.condition>" and then change the cat line so that 
different files are returned depending on the subject the sender puts in.
the last recipe saves the address that the request came from in a file 
called autobot.log.  I don't know if it was nessary but before I ran my 
test I used the command "cp /dev/null autobot.log" to create an empty 
file so that there would be something to append to.

MAILDIR=$HOME/mail
DEFAULT=$MAILDIR/inbox
LOGFILE=$MAILDIR/from
LOCKFILE=$HOME/.lockmail
SENDMAIL=/usr/sbin/sendmail

:0 c
backup

:0 h c
*!^FROM_DEAMON
*!^X-Loop: info(_at_)earth(_dot_)mat(_dot_)net
|(formail -r -A "Precedence: junk"\
-I"From: Auto Reply from Mat.Net <info(_at_)earth(_dot_)mat(_dot_)net>" \
-I"Subject: Information Request" \
-A "X-Loop: info(_at_)earth(_dot_)mat(_dot_)net";\
cat /usr/home/info/info.txt )|$SENDMAIL -t


:0 c:
* ^TOinfo(_at_)earth(_dot_)mat(_dot_)net
| formail -rtzxTo: >> /usr/home/info/autobot.log



2.    Is procmail a preferred way to set up an autoresponder under
UNIX/Silicon Graphics IRIX5.3, or does anybody recommend differently?

I don't know about that system but it works great on BSDI 2.0.1. 


Massimo Fuchs
Discovery Telecom

-- 
mfuchs(_at_)netfone(_dot_)com



******************************************************************************
  /\    Mark Mathis     Micro Access Technologies  "Behind every successful
 /\/\   Mark(_at_)Mat(_dot_)Net PO Box 92224               cat is an obedient 
owner"
/\/\/\  202/529-5001    Washington, DC  20090
******************************************************************************

<Prev in Thread] Current Thread [Next in Thread>