# SMTP settings for action mailer

**URL:** <https://www.ruby-forum.com/t/smtp-settings-for-action-mailer/157184>\
**Category:** Rails\
**Created:** [January 8, 2009, 9:16am UTC](https://www.ruby-forum.com/t/smtp-settings-for-action-mailer/157184 "2009-01-08T09:16:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tyanlion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f0a364/32.png) [@tyanlion](https://www.ruby-forum.com/u/tyanlion)\
**Post date:** [January 8, 2009, 9:16am UTC](https://www.ruby-forum.com/t/smtp-settings-for-action-mailer/157184/1 "2009-01-08T09:16:14Z")

</div>

with rails 2.2.2 action mailer requires a valid ssl certificate  
i have a question about routing

my smtp settings for my postfix are now

ActionMailer::Base.smtp\_settings = {  
:address =\> “[smtp.mydomain.com](http://smtp.mydomain.com)”,  
:port =\> 25,  
:domain =\> “[mydomain.com](http://mydomain.com)”,  
:authentication =\> :plain,  
:user\_name =\> “removed\_email\_address@domain.invalid”,  
:password =\> “password”  
}

both the email server and the rails app are on the same machine  
if i don’t have the address as 127.0.0.1  
is it routing information through the internet instead of internally  
in the machine?  
if i use 127.0.0.1 i will get the ssl error because the host does not  
match up.

---

<div class="post-metadata">

**Author:** ![tyanlion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f0a364/32.png) [@tyanlion](https://www.ruby-forum.com/u/tyanlion)\
**Post date:** [January 8, 2009, 9:25am UTC](https://www.ruby-forum.com/t/smtp-settings-for-action-mailer/157184/2 "2009-01-08T09:25:05Z")

</div>

Hi,

In your server’s host file map the address [smtp.mydomain.com](http://smtp.mydomain.com) to IP  
127.0.0.1  
so that it is not routed externally.

-NAYAK

---

<div class="post-metadata">

**Author:** ![tyanlion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f0a364/32.png) [@tyanlion](https://www.ruby-forum.com/u/tyanlion)\
**Post date:** [January 8, 2009, 10:34am UTC](https://www.ruby-forum.com/t/smtp-settings-for-action-mailer/157184/3 "2009-01-08T10:34:09Z")

</div>

Hi,

I am not sure of using multiple host/domain at a time there  
Try just

127.0.0.1 [smtp.mydomain.com](http://smtp.mydomain.com)

NAYAK

---

<div class="post-metadata">

**Author:** ![tyanlion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f0a364/32.png) [@tyanlion](https://www.ruby-forum.com/u/tyanlion)\
**Post date:** [January 8, 2009, 10:45am UTC](https://www.ruby-forum.com/t/smtp-settings-for-action-mailer/157184/4 "2009-01-08T10:45:56Z")

</div>

I got it to work with the multiple domain names

ActionMailer::Base.smtp\_settings = {  
:address =\> “[smtp.mydomain.com](http://smtp.mydomain.com)”,  
:port =\> 25,  
:domain =\> “[mydomain.com](http://mydomain.com)”,  
:authentication =\> :plain,  
:user\_name =\> “removed\_email\_address@domain.invalid”,  
:password =\> “password”  
}

I have the address as [smtp.mydomain.com](http://smtp.mydomain.com) and it gives 127.0.0.1 in my  
mail error log. Instead of [ns1.mydomain.com](http://ns1.mydomain.com) .

Is it working internally now?

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of NAYAK  
Sent: Thursday, January 08, 2009 5:34 PM  
To: removed\_email\_address@domain.invalid  
Subject: [Rails] Re: SMTP settings for action mailer

Hi,

I am not sure of using multiple host/domain at a time there  
Try just

127.0.0.1 [smtp.mydomain.com](http://smtp.mydomain.com)

NAYAK

On Thu, Jan 8, 2009 at 2:57 PM, Tan YL [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

I tried changing it to this :

127.0.0.1 localhost.localdomain localhost [smtp.mydomain.com](http://smtp.mydomain.com) smtp

::1 localhost6.localdomain6 localhost6

210.193.49.222 [ns1.mydomain.com](http://ns1.mydomain.com) ns1 localhost [smtp.mydomain.com](http://smtp.mydomain.com) smtp

But it didn’t work

Restarted postfix and mongrel gave ssl error again.

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of NAYAK  
Sent: Thursday, January 08, 2009 4:24 PM  
To: removed\_email\_address@domain.invalid  
Subject: [Rails] Re: SMTP settings for action mailer

Hi,

In your server’s host file map the address [smtp.mydomain.com](http://smtp.mydomain.com) to IP  
127.0.0.1 so that it is not routed externally.

-NAYAK

On Thu, Jan 8, 2009 at 1:45 PM, tyliong [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

with rails 2.2.2 action mailer requires a valid ssl certificate  
i have a question about routing

my smtp settings for my postfix are now

ActionMailer::Base.smtp\_settings = {  
:address =\> “[smtp.mydomain.com](http://smtp.mydomain.com)”,  
:port =\> 25,  
:domain =\> “[mydomain.com](http://mydomain.com)”,  
:authentication =\> :plain,  
:user\_name =\> “removed\_email\_address@domain.invalid”,  
:password =\> “password”  
}

both the email server and the rails app are on the same machine  
if i don’t have the address as 127.0.0.1  
is it routing information through the internet instead of internally  
in the machine?  
if i use 127.0.0.1 i will get the ssl error because the host does not  
match up.

---

<div class="post-metadata">

**Author:** ![tyanlion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f0a364/32.png) [@tyanlion](https://www.ruby-forum.com/u/tyanlion)\
**Post date:** [January 8, 2009, 10:18am UTC](https://www.ruby-forum.com/t/smtp-settings-for-action-mailer/157184/5 "2009-01-08T10:18:04Z")

</div>

I tried changing it to this :

127.0.0.1 localhost.localdomain localhost [smtp.mydomain.com](http://smtp.mydomain.com) smtp

::1 localhost6.localdomain6 localhost6

210.193.49.222 [ns1.mydomain.com](http://ns1.mydomain.com) ns1 localhost [smtp.mydomain.com](http://smtp.mydomain.com) smtp

But it didnâ€™t work

Restarted postfix and mongrel gave ssl error again.

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of NAYAK  
Sent: Thursday, January 08, 2009 4:24 PM  
To: removed\_email\_address@domain.invalid  
Subject: [Rails] Re: SMTP settings for action mailer

Hi,

In your server’s host file map the address [smtp.mydomain.com](http://smtp.mydomain.com) to IP  
127.0.0.1 so that it is not routed externally.

-NAYAK

On Thu, Jan 8, 2009 at 1:45 PM, tyliong [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

with rails 2.2.2 action mailer requires a valid ssl certificate  
i have a question about routing

my smtp settings for my postfix are now

ActionMailer::Base.smtp\_settings = {  
:address =\> “[smtp.mydomain.com](http://smtp.mydomain.com)”,  
:port =\> 25,  
:domain =\> “[mydomain.com](http://mydomain.com)”,  
:authentication =\> :plain,  
:user\_name =\> “removed\_email\_address@domain.invalid”,  
:password =\> “password”  
}

both the email server and the rails app are on the same machine  
if i don’t have the address as 127.0.0.1  
is it routing information through the internet instead of internally  
in the machine?  
if i use 127.0.0.1 i will get the ssl error because the host does not  
match up.
