# Actionmailer environment

**URL:** <https://www.ruby-forum.com/t/actionmailer-environment/137302>\
**Category:** Rails\
**Created:** [May 11, 2008, 6:45pm UTC](https://www.ruby-forum.com/t/actionmailer-environment/137302 "2008-05-11T18:45:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![snowbird122](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Post date:** [May 11, 2008, 6:45pm UTC](https://www.ruby-forum.com/t/actionmailer-environment/137302/1 "2008-05-11T18:45:30Z")

</div>

I’m trying to receive emails into my rails app. The using this method:  
[http://wiki.rubyonrails.org/rails/pages/HowToReceiveEmailsWithActionMailer](http://wiki.rubyonrails.org/rails/pages/HowToReceiveEmailsWithActionMailer)

It appears to be passing the email in using the development environment  
instead of production. How can I make it use production? The rest of  
my app is using production as specified in my mongrel configuration.

---

<div class="post-metadata">

**Author:** ![snowbird122](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Post date:** [May 11, 2008, 9:48pm UTC](https://www.ruby-forum.com/t/actionmailer-environment/137302/2 "2008-05-11T21:48:43Z")

</div>

Worked great, thanks.

Here is the syntax from my /etc/aliases file:  
email\_alias: “| /usr/bin/ruby /path/to/app/script/runner -e production  
‘IncomingMailProductRequest.receive STDIN.read’”

---

<div class="post-metadata">

**Author:** ![snowbird122](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Post date:** [May 11, 2008, 8:17pm UTC](https://www.ruby-forum.com/t/actionmailer-environment/137302/3 "2008-05-11T20:17:47Z")

</div>

On 11 May 2008, at 17:45, Eric M. wrote:

> I’m trying to receive emails into my rails app. The using this  
> method:  
> [http://wiki.rubyonrails.org/rails/pages/HowToReceiveEmailsWithActionMailer](http://wiki.rubyonrails.org/rails/pages/HowToReceiveEmailsWithActionMailer)
> 
> It appears to be passing the email in using the development  
> environment  
> instead of production. How can I make it use production? The rest of  
> my app is using production as specified in my mongrel configuration.

script/runner takes a -e option which specifies the environment to use.

Fred

–  
My ramblings: [http://www.spacevatican.org](http://www.spacevatican.org)
