ActionMailer Timeout

I am in the process of deploying an app to a shared server at GoDaddy.
I know, GoDaddy sucks, I didn’t realize that until I had paid for 2
years in advance.

Anyway, everything is working fine except for one thing. I am using
ActionMailer to send SMTP emails from the app and am receiving a
timeout. I have tried everything I can think of as far as changing my
configuration. I am a first-timer so this could be a very basic
mistake. Any guidance would be appreciated.

My environment.rb file (excerpt):

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.server_settings = {
:address => “smtpout.secureserver.net”,
:port => 80,
:domain => “www.mydomain.com”,
:authentication => :login,
:user_name => “[email protected]”,
:password => “xxxxxxxx”
}

################################################################
Error in the log:

Timeout::Error (execution expired):
/usr/local/lib/ruby/1.8/timeout.rb:54:in rbuf_fill' /usr/local/lib/ruby/1.8/timeout.rb:56:in timeout’
/usr/local/lib/ruby/1.8/timeout.rb:76:in timeout' /usr/local/lib/ruby/1.8/net/protocol.rb:132:in rbuf_fill’
/usr/local/lib/ruby/1.8/net/protocol.rb:116:in readuntil' /usr/local/lib/ruby/1.8/net/protocol.rb:126:in readline’
/usr/local/lib/ruby/1.8/net/smtp.rb:664:in recv_response' /usr/local/lib/ruby/1.8/net/smtp.rb:396:in do_start’
/usr/local/lib/ruby/1.8/net/smtp.rb:686:in critical' /usr/local/lib/ruby/1.8/net/smtp.rb:396:in do_start’
/usr/local/lib/ruby/1.8/net/smtp.rb:378:in start' /usr/local/lib/ruby/1.8/net/smtp.rb:316:in start’
/vendor/rails/actionmailer/lib/action_mailer/base.rb:511:in
perform_delivery_smtp' /vendor/rails/actionmailer/lib/action_mailer/base.rb:397:in deliver!’
/vendor/rails/actionmailer/lib/action_mailer/base.rb:291:in
method_missing' /app/controllers/main_controller.rb:43:in mail_request’
/vendor/rails/actionpack/lib/action_controller/base.rb:941:in
perform_action_without_filters' /vendor/rails/actionpack/lib/action_controller/filters.rb:368:in perform_action_without_benchmark’
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:in measure’
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /vendor/rails/actionpack/lib/action_controller/rescue.rb:82:in perform_action’
/vendor/rails/actionpack/lib/action_controller/base.rb:408:in
process_without_filters' /vendor/rails/actionpack/lib/action_controller/filters.rb:377:in process_without_session_management_support’
/vendor/rails/actionpack/lib/action_controller/session_management.rb:117:in
process' /vendor/rails/railties/lib/dispatcher.rb:38:in dispatch’
/vendor/rails/railties/lib/fcgi_handler.rb:150:in process_request' /vendor/rails/railties/lib/fcgi_handler.rb:54:in process!’
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in
each_cgi' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in each_cgi’
/vendor/rails/railties/lib/fcgi_handler.rb:53:in process!' /vendor/rails/railties/lib/fcgi_handler.rb:23:in process!’
/home/content/b/a/m/bamiller3/html/eastside/public/dispatch.fcgi:24

In your options, the port is set to 80, which is the http port. The
SMTP port is typically port 25, although you may want to check with
them to see if they want you to use a different one.

I had tried port 25 the first time. I changed to to 80 to see if it
would work because the instructions for setting up outlook express to
use the same smtp server use port 80. Both ports give me the same
error.

I just realized something that might be the cause of this problem.
Correct me if I am wrong, but don’t you have to restart the web server
when changes are made to the environment.rb file?

It hit me because, I changed the log_level to :debug and never saw the
effect of that change. I think I have been trying all kinds of
combinations of SMTP settings and none actually took effect. In a
shared hosting situation (specifically GoDaddy) how could I force my
changes to the environment.rb file to take effect? Is there a way for
me to restart my own instance of the web server? Any thoughts on this
would be appreciated.

Try this…

ActionMailer::Base.server_settings = {
:address => “localhost”,
:domain => ‘www.yourdomain.com’,
:port => 25
}

On 5/29/07, Vince W. [email protected] wrote:

when changes are made to the environment.rb file?

“Eppure si muove”

@Jose G.

OMG that worked! I can’t believe the morons at GoDaddy couldn’t just
tell me that the webservers run local SMTP-relay, with no
authentication. You rock, Thanks so much!

I don’t think you need to restart the server anymore in rails > 1.2
but I find that it never hurts. One less thing you need to eliminate,
so if you can restart you may as well.

On 5/29/07, Brent M. [email protected] wrote:

me to restart my own instance of the web server? Any thoughts on this
would be appreciated.


Posted via http://www.ruby-forum.com/.


support independent business – http://www.buyindie.net/