# Trying to receive emails with ActionMailer + Postfix

**URL:** <https://www.ruby-forum.com/t/trying-to-receive-emails-with-actionmailer-postfix/187436>\
**Category:** Rails\
**Created:** [April 23, 2010, 3:53am UTC](https://www.ruby-forum.com/t/trying-to-receive-emails-with-actionmailer-postfix/187436 "2010-04-23T03:53:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![webo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/90ced4/32.png) [@webo](https://www.ruby-forum.com/u/webo)\
**Post date:** [April 23, 2010, 3:53am UTC](https://www.ruby-forum.com/t/trying-to-receive-emails-with-actionmailer-postfix/187436/1 "2010-04-23T03:53:31Z")

</div>

I’ve been having a world of issues with trying to get ActionMailer  
(using Rails 3.0 beta 2) to receive emails from Postfix.

Currently in Postfix’s aliases file I have the line:  
rails\_mailer: | “/home/directory/to/app/script/rails runner  
‘MailReceive.recieve(STDIN.read)’”

And in my Mailer that should be receiving it I have a method defined as  
such:

def receive (email)  
…  
…  
end

However when I send an email to the server and try to manipulate the  
email object (for instance comparing email.to against another string) it  
tells me it cannot convert from nil to String. I don’t think it’s  
receiving the email properly but I’m not sure what’s failing with the  
email forwarding.

Any help would be greatly appreciated.
