procmail
[Top] [All Lists]

Re: intelligent autoresponder

1997-01-13 13:57:40
Hi,
I found following statement in a readme file:

If I want to add a second autoresponder, say 
autoresponder2(_at_)domain(_dot_)com
(with the file autoresponder.txt in the $FILEDIR) I have do copy
the above commands...

But this is pretty much work to be done for many addresses :-(

Does anybody have a good idea - or even already programmed - an
"intelligent" autoresponder?


        I think you want to look in the procmailex man page
        (the "examples" collection) for the "fileserver" 
        recipe (which I've quoted below):


       Now follows an example for a very simple fileserver acces-
       sible by mail.  For more demanding applications, I suggest
       you  take  a  look  at  SmartList (available from the same
       place as the  procmail  distribution).   As  listed,  this
       fileserver  sends  back  at  most one file per request, it
       ignores the body of incoming mails, the Subject: line  has
       to  look  like "Subject: send file the_file_you_want" (the
       blanks are significant), it does  not  return  files  that
       have names starting with a dot, nor does it allow files to
       be retrieved that are  outside  the  fileserver  directory
       tree  (if  you decide to munge this example, make sure you
       do not inadvertently loosen this last restriction).

              :0
              * ^Subject: send file [0-9a-z]
              * !^X-Loop: yourname(_at_)your(_dot_)main(_dot_)mail(_dot_)address
              * !^Subject:.*Re:
              * !^FROM_DAEMON
              * !^Subject: send file .*[/.]\.
              {
                MAILDIR=$HOME/fileserver # chdir to the fileserver directory

                :0 fhw               # reverse mailheader and extract name
                * ^Subject: send file \/[^ ]*
                | formail -rA "X-Loop: 
yourname(_at_)your(_dot_)main(_dot_)mail(_dot_)address"

                FILE="$MATCH"        # the requested filename

                :0 ah
                | cat - ./$FILE 2>&1 | $SENDMAIL -oi -t
              }

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