First, just try printing <STDIN> to the screen. 

!#/usr/bin/perl

print"<STDIN>\n";
To see exactly what/how it is getting there.

Next, you'll want to start parsing the file.  Not quite sure what you are
trying to grep out of these files.  But for example, if you have an order
form and you want customer information, you could try and if statement that
looks for something similar to "Name:".

if ($name ~= /Name:/){
        whatever you want to do with this.
}

But important point for you or anyone doing this stuff.  Check your input
for taintness - by taking out all unnecessesary characters.  Don't trust
anything coming from an outside source.  You also may want to grep for
things out of the header of the message - lest spam attack you.

I'm not quite sure what direction you are going with this, what you want to
do with the parsed email, so I don't know what direction to continue with my
response.  If you want to clarify, I'll try to help.

-----Original Message-----
From: Javier Bellido [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 11:40 PM
To: [EMAIL PROTECTED]
Subject: pipeing files to a script


Hi, friends!

I'd like to process e-mails with a script. I use getmail to fetch the
mail in a pop3 account and I can filter messages and send them to my
script using the pipe "|" but I don't know how make a script process a
file. Can you give me some clue? 

Something like:

messages from [EMAIL PROTECTED] |/usr/lib/cgi-bin/myscript


Thanks people.



Javier B


_____________________________________________________________________
Correo gratis con POP3, IMAP, en 18 idiomas...: http://www.mundomail.net
100 MB para tu web y mucho más: http://www.vermail.net



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to