# Postfix -\> perl/ruby (ActionMailer) question

**URL:** <https://www.ruby-forum.com/t/postfix-perl-ruby-actionmailer-question/57952>\
**Category:** Ruby\
**Created:** [April 17, 2006, 1:27am UTC](https://www.ruby-forum.com/t/postfix-perl-ruby-actionmailer-question/57952 "2006-04-17T01:27:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ror-user](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/22d042/32.png) [@ror-user](https://www.ruby-forum.com/u/ror-user)\
**Post date:** [April 17, 2006, 1:27am UTC](https://www.ruby-forum.com/t/postfix-perl-ruby-actionmailer-question/57952/1 "2006-04-17T01:27:04Z")

</div>

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/HowToReceiveEmailsWithActionMailer](http://wiki.rubyonrails.com/rails/pages/HowToReceiveEmailsWithActionMailer)

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
