# Getting action mailer to work on OSX with sendmail

**URL:** <https://www.ruby-forum.com/t/getting-action-mailer-to-work-on-osx-with-sendmail/116745>\
**Category:** Rails\
**Created:** [October 9, 2007, 9:15am UTC](https://www.ruby-forum.com/t/getting-action-mailer-to-work-on-osx-with-sendmail/116745 "2007-10-09T09:15:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elemental](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/6de8d8/32.png) [@elemental](https://www.ruby-forum.com/u/elemental)\
**Post date:** [October 9, 2007, 9:15am UTC](https://www.ruby-forum.com/t/getting-action-mailer-to-work-on-osx-with-sendmail/116745/1 "2007-10-09T09:15:33Z")

</div>

Hi all,  
I’m trying to get action mailer to work with my dev environment on my  
OS x  
laptop. I have the following configuration for action mailer in my  
development.rb

ActionMailer::Base.raise\_delivery\_errors = true

#send mail with sendmail  
ActionMailer::Base.delivery\_method = :sendmail

Everything appears to go ok, but when I view my mail.log file from my  
mail  
viewer, I see the following.

Oct 9 20:09:08 todd postfix/smtp[4648]: 0AC052D9B96: to=\<  
removed\_email\_address@domain.invalid\>, relay=none, delay=92235, status=deferred (Host or  
domain name not found. Name service error for [name=gmail.com](http://name=gmail.com) type=MX:  
Host  
not found, try again)  
Oct 9 20:09:08 todd postfix/smtp[4650]: 8C284486133: to=\<  
removed\_email\_address@domain.invalid\>, relay=none, delay=76, status=deferred (Host or  
domain  
name not found. Name service error for [name=gmail.com](http://name=gmail.com) type=MX: Host not  
found, try again)  
Oct 9 20:09:08 todd postfix/smtp[4651]: CF9D72D9B52: to=\<  
removed\_email\_address@domain.invalid\>, relay=none, delay=92446, status=deferred (Host or  
domain name not found. Name service error for [name=gmail.com](http://name=gmail.com) type=MX:  
Host  
not found, try again)  
Oct 9 20:09:08 todd postfix/smtp[4649]: 5B6612D9C3D: to=\<  
removed\_email\_address@domain.invalid\>, relay=none, delay=90714, status=deferred (Host or  
domain name not found. Name service error for [name=gmail.com](http://name=gmail.com) type=MX:  
Host  
not found, try again)

I know this is an OSX issue, and not a ruby issue, but if anyone has set  
up  
Actionmailer on OSX (sendmail or otherwise), can you send me some info  
on  
how you were able to get it working? All of the tutorials I find on  
sendmail and osx are about 10 pages long and involve receiving email. I  
don’t want to set up an email server, I just want to be able to send  
test  
email!

Thanks,  
Todd

---

<div class="post-metadata">

**Author:** ![elemental](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/6de8d8/32.png) [@elemental](https://www.ruby-forum.com/u/elemental)\
**Post date:** [October 9, 2007, 9:41am UTC](https://www.ruby-forum.com/t/getting-action-mailer-to-work-on-osx-with-sendmail/116745/2 "2007-10-09T09:41:22Z")

</div>

What does ‘dig [gmail.com](http://gmail.com) mx’ say? It’s possible your ISP is somehow  
thinking that blocking MX queries will cause you not to send spam when  
someone gets a virus.

For me, it says:

; \<\<\>\> DiG 9.4.1-P1 \<\<\>\> [gmail.com](http://gmail.com) mx  
;; global options: printcmd  
;; Got answer:  
;; -\>\>HEADER\<\<- opcode: QUERY, status: NOERROR, id: 3508  
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 4, ADDITIONAL: 0

;; QUESTION SECTION:  
;[gmail.com](http://gmail.com). IN MX

;; ANSWER SECTION:  
[gmail.com](http://gmail.com). 3600 IN MX 10  
[alt1.gmail-smtp-in.l.google.com](http://alt1.gmail-smtp-in.l.google.com).  
[gmail.com](http://gmail.com). 3600 IN MX 10  
[alt2.gmail-smtp-in.l.google.com](http://alt2.gmail-smtp-in.l.google.com).  
[gmail.com](http://gmail.com). 3600 IN MX 50 [gsmtp163.google.com](http://gsmtp163.google.com).  
[gmail.com](http://gmail.com). 3600 IN MX 50 [gsmtp183.google.com](http://gsmtp183.google.com).  
[gmail.com](http://gmail.com). 3600 IN MX 5  
[gmail-smtp-in.l.google.com](http://gmail-smtp-in.l.google.com).

;; AUTHORITY SECTION:  
[gmail.com](http://gmail.com). 345600 IN NS [ns1.google.com](http://ns1.google.com).  
[gmail.com](http://gmail.com). 345600 IN NS [ns4.google.com](http://ns4.google.com).  
[gmail.com](http://gmail.com). 345600 IN NS [ns3.google.com](http://ns3.google.com).  
[gmail.com](http://gmail.com). 345600 IN NS [ns2.google.com](http://ns2.google.com).

;; Query time: 169 msec  
;; SERVER: 10.42.255.254#53(10.42.255.254)  
;; WHEN: Tue Oct 9 02:38:32 2007  
;; MSG SIZE rcvd: 230

---

<div class="post-metadata">

**Author:** ![elemental](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/6de8d8/32.png) [@elemental](https://www.ruby-forum.com/u/elemental)\
**Post date:** [October 9, 2007, 11:31am UTC](https://www.ruby-forum.com/t/getting-action-mailer-to-work-on-osx-with-sendmail/116745/3 "2007-10-09T11:31:45Z")

</div>

You’re correct. Dig works fine for everything except MX records. It  
doesn’t  
work for gmail, hotmail, or yahoo. Since I can’t go the easy route and  
just  
use sendmail, I have to connect to an SMTP server. Gmail requires TLS,  
and  
I don’t want to set up yet another external dependency in testing. I  
managed to find my ISP’s smtp setting and set it up with the following  
actionmailer config.

ActionMailer::Base.smtp\_settings = {  
:address =\> “send.xtra.co.nz”,  
:port =\> 587,  
:user\_name =\> “barneygumble”,  
:password =\> “yeahright!”,  
:authentication =\> :login  
}

Thanks for the help Michael!

Todd
