Subject: Re: getting files

From: Eric Force <[email-masked]>
Date: Sun, 8 Jan 1995 18:44:29 -0500 (EST)

Hi Peter,

This is what works for me. The "loop" in the .procmailrc file
will "search" for any filename specified after the "send" in
my fileserver subdirectory.

See my .signature file at the end of this message to see an
example application for this type of procedure. 

Hope this helps. I also want to say thanks to Nancy McGough 
for her help in getting *me* on the right track!

Best Regards,

Eric

Here's my .forward file:

"|IFS=' ' && exec /usr/local/bin/procmail || exit 75 #xword"

And here's the .procmailrc file that does the "magic":

          :0 c
          * !^X-Loop: [email-masked]
          * !^Subject:.*Re:
          * !^FROM_DAEMON
          * ^Subject:.*send
          {
            MAILDIR=$HOME/fileserver   # chdir to the fileserver directory

            :0 h             # extract the requested filename(s)
            FILES=| sed -n -e 's/^Subject:.*send \(.*\)/\1/p'

            :0 f                # reverse the mailheader
            | formail -rA "X-Loop: [email-masked]"

            :0
            | (cat; cat $FILES) | $SENDMAIL -oi -t
           
          }

> > Peter Stark wrote,
> > 
> > | Anyone know in procmail how to get files from a certain directory?
> > | 
> > | I am trying to set up a command people can use in the subject of a 
> > | message to get the files I have in a certain directory.
> > 

 =======================================================================
  |   Have a Great Day!  | FREE Crossword Puzzles via Email - Fun for |
  |      Eric Force      | All.  New Puzzles Daily. For Information:  |
  | [email-masked] |  -->   finger [email-masked]   <--    |
 =======================================================================

---

From: "Peter Stark Jr." <[email-masked]>
Date: Mon, 9 Jan 1995 15:47:54 -0500 (EST)

Hello. I just tried the script that Eric Force sent. Interesting enough, 
I have gotten an interesting problem.

It was suggested I use the following, and I made the modifications I 
needed:

>           :0 c
>           * !^X-Loop: [email-masked]
>           * !^Subject:.*Re:
>           * !^FROM_DAEMON
>           * ^Subject:.*sendonly
>           {
> 
>             FILES=| sed -n -e 's/^Subject:.*sendonly \(.*\)/\1/p'
> 
>             | formail -rA "X-Loop: [email-masked]"
> 
>             :0
>             | (cat; cat ~list/seaquest/archive/$FILES) | $SENDMAIL -oi -t
>
>             }            
However, here is the problem: All the mail I now get, are sent into it. 
Yes. I know how that is impossible. Yet it is happening. All the mail I 
get, even without the subject: sendonly it goes to it also. See? Here is 
the log file:

 Subject: Re: Returned mail: User unknown
  Folder:  (cat; cat ~list/seaquest/archive/$FILES) | $SENDMAIL -oi -t	    199
cat: read error on /home/rever1/list/seaquest/archive/: Is a directory
 Subject: Re: Returned mail: User unknown
  Folder:  (cat; cat ~list/seaquest/archive/$FILES) | $SENDMAIL -oi -t	    199
cat: read error on /home/rever1/list/seaquest/archive/: Is a directory

It goes on for another 20 times...I think it is infinate. Because when I 
take this area out from procmailrc, I get a message saying user unknown 
and leaves me a message.

Any suggestions?

Thanks.

Peter Stark
Quindel