Here's how I do that. @razorout is the output from the razor check. This assumes the message to check is STDIN. You need the IPC::Open2 module if it is not installed by default.
use IPC::Open2; @inlines = <STDIN>; $wholemessage = join("", @inlines); my $pid = open2(RAZOR_READ, RAZOR_WRITE, "razor-check -d -lm 5 -home=/etc/razor"); print RAZOR_WRITE $wholemessage; close (RAZOR_WRITE); @razorout = <RAZOR_READ>; ----- Original Message ----- From: "Jon Oringer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 18, 2002 7:40 PM Subject: [Razor-users] Razor-check & Mail::MboxParser > I have a perl script take in email messages - and enter the data into a > DB.. I would like to check the messages against razor-check.. But the > method im using isn't working.. Here is the code.. Can anybody see > anything wrong with this? > > I'm using Postfix.. /etc/aliases says: > > support: "|/usr/bin/perl /home/mailman/sql_the_mail.pl" > > Here is the sql_the_main.pl code > > while(<STDIN>) { $bod .= $_; } > > my $mb = Mail::MboxParser->new(\$bod); > for my $msg ($mb->get_messages) { > ... > open(G,">/tmp/razor$randnum"); > print G $bod; > close G; > my $razor_res = `cat /tmp/razor$randnum | razor-check`; > ... > } > > $razor_res never contains any data > > Any ideas? > > -Jon > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: Order your Holiday Geek Presents Now! > Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap, > MP3 Players, XBox Games, Flying Saucers, WebCams, Smart Putty. > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > _______________________________________________ > Razor-users mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/razor-users ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Razor-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/razor-users