Forum: Ruby postfix -> perl/ruby (ActionMailer) question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Rohit M. (Guest)
on 2006-04-17 03:27
(Received via mailing list)
Hi guys, I am a ruby nuby, and am trying to learn ruby while setting up
a craigslist-like site.
So instead of going all out with ActionMailer, right now I am trying to
start very simple with perl and am having difficulties.

I read this document:
http://wiki.rubyonrails.com/rails/pages/HowToRecei...

and modified my main.cf, transport, and master.cf.

The line added to my master.cf looks like this:
#stuff for rubymail 2006.04.16
rmail  unix  -       n       n       -       -       pipe  flags=FR
user=nobody argv=/usr/local/bin/mailtest.pl ${user}

I'm assuming the message should be passed to my program as STDIN, so
something very simple like
the following, should write the recieved message to a file:

#!/usr/bin/perl

open (OF,">>/var/log/rmail.log");
print OF "newmessage\n";
while (<>) {
 print OF $_;
}
print OF "-------------------------------------------------------\n";

Now when I send mail to removed_email_address@domain.invalid, mailtest.pl
is invoked and data is
written to /var/log/rmail.log.  However only the following lines are
written:

newmessage
-------------------------------------------------------

I can trigger my script from postfix, but I don't get the contents of
message.

Obviously this is more  a postfix question than a ruby question, but
many of you Rails gurus may
have seen this before.

Thanks for any help,

Rohit
This topic is locked and can not be replied to.