procmail
[Top] [All Lists]

Recipe help needed

1996-09-26 14:21:52

Hi, 

I would like to offer free sgml validation so folks can parse their web
pages and other sgml documents.  (I work on a project that is
developing public domain dtds for corpus tagging)  I have been trying 
to use procmail but I must be doing something wrong.

Here is what I want it to do:

When someone sends mail to a special user (probably named "parse-me")
it will all be forwarded to me via a mail alias (before procmail gets
it of course, this part is not a problem).

The subject line of the message is the dtd they want used (for
security resons I can't allow any external entites in the document -
wouln't want somewone mailing themselvfs the password file)

so far no problem, all standard stuff.

then, once we have a file with a dtd that matches, I need to take the
body of the message, pipe it through some stuff (sgmls and a fileter
to make it more readable) and then send that file back to the sender,
additionally I would like a log entry of the person that used it and
which dtd they parsed.

This is where I run into trouble.  I have been able to get procmail to
detect the message, kik the body off to a temp file, process it into
another temp file and send a reply to the user - but I don't see how to
get the temp file into the reply message!

I have simplified the process for now (for testing) here is what I am
trying.   This does put the output into $TEMP2 but it does not include
it in the message.  What am I missing?

:0 b c
* ^Subject: HTML3.2.dtd
|cat  > $TEMPORARY ; \
 sgmls /usr/local/lib/sgml/html.decl $TEMPORARY > $TEMP2 ; rm -f $TEMPORARY

:0 h
* ^Subject: HTML3.2.dtd
| (formail -r -A"Precedence: junk" ; \
   cat  $TEMP2 )| $SENDMAIL -t


needless to say, I am open to other aproces to solving the problem.

Thanks,

Greg Priest-Dorman

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