ActionMailer getaddrinfo: Name or service not known..

When I deploy my rails 2.2.2 app to bluehost, I'm having trouble with the ActionMailer SMTP settings.

When I attempt to send emails through Rails/SMTP, I get the following error message:

getaddrinfo: Name or service not known

google says that this means there's an error negotiating with the mail server.

Here are the settings I'm using for SMTP delivery:

config.action_mailer.smtp_settings = { :domain => 'domain.com', :address => 'mail.domain.com', :port => 25, :user_name => 'user@domain.com', :password => 'passwd', :authentication => :login }

I've attempted setting domain to localhost/127.0.0.1 as google prescribes, but I'm still experiencing the issue. So I did a telnet session with the SMTP service and I receieved a 550 status error (550 Administrative prohibition).

After communicating with bluehost support, they reconfig'd the SMTP service so that all mails originating from the local network would be relayed and the telnet SMTP session was successful.

But my app is still failing to communicate with the SMTP service.

I turned on debug level logging and the log file tells me that the email is successfully generated and sent to its intended recipient, then it gives me the getaddrinfo: Name or service not known error again.

I also attempted to config the application to use sendmail, and it fails with exactly the same error. getaddrinfo: Name or service not known error.

I attempted a debug session using the production console:

Loading production environment (Rails 2.2.2)

UserMailer.deliver_contact_form 'test', 'jts@gmail.com', 'test', 'test'

SocketError: getaddrinfo: Name or service not known         from /usr/lib/ruby/1.8/net/protocol.rb:206:in `initialize'         from /usr/lib/ruby/1.8/net/protocol.rb:206:in `new'         from /usr/lib/ruby/1.8/net/protocol.rb:206:in `old_open'         from /usr/lib/ruby/1.8/timeout.rb:62:in `timeout'         from /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'         from /usr/lib/ruby/1.8/net/protocol.rb:206:in `old_open'         from /usr/lib/ruby/1.8/net/smtp.rb:392:in `do_start'         from /usr/lib/ruby/1.8/net/smtp.rb:377:in `start'         from /home/jts/ruby/gems/gems/actionmailer-2.2.2/lib/ action_mailer/base.rb:671:in `perform_delivery_smtp'         from /home/jts/ruby/gems/gems/actionmailer-2.2.2/lib/ action_mailer/base.rb:526:in `__send__'         from /home/jts/ruby/gems/gems/actionmailer-2.2.2/lib/ action_mailer/base.rb:526:in `deliver!'         from /home/jts/ruby/gems/gems/actionmailer-2.2.2/lib/ action_mailer/base.rb:392:in `method_missing'         from (irb):1

I've been pulling my hair out over this for more than a week now! If anyone can offer any insight, advice, suggestion, that'd be super!

cheers, j