I have setup an alias in /etc/aliases
so that each time an email comes in to a specific address, the text of the email is sent to a Ruby script. Like so:
example: |/etc/smrsh/my_script.rb
I need to know how to read the piped data in my Ruby script.. I have written a simple Perl script that can read the data.. just can't figure out how to do it in Ruby.
Here is the relevant lines in the Perl script:
my $fout = "/tmp/email.out";
open( EM, ">$fout" );
while( <> ) {
chomp;
print EM "$_\n";
}