internal server error(500) when attempting to sendmail

Hello,

I have an application that, when you create an appointment it sends an
email to the client to say someone has just booked.

Locally, this works fine (i'm just using sendmail)

Locally - all email tests have come through - no problem.

However - when I copy all the files onto the server and attempt to
create a booking, it comes up with the 500 page. The error below if
taken from my server logs:

Please NOte - I have another site which uses the same sendmail
functionality, and i've never had a problem.

Any ideas?

OpenSSL::SSL::SSLError (hostname was not match with the server
certificate):
  /usr/lib/ruby/1.8/openssl/ssl.rb:123:in `post_connection_check'
  /usr/lib/ruby/1.8/net/smtp.rb:582:in `tlsconnect'
  /usr/lib/ruby/1.8/net/smtp.rb:562:in `do_start'
  /usr/lib/ruby/1.8/net/smtp.rb:525:in `start'
  app/controllers/appointments_controller.rb:60:in `create'
  app/controllers/appointments_controller.rb:52:in `create'
  /usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in
`process_request'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:
207:in `main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:
385:in `start_request_handler'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:
343:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:
341:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in
`__send__'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in
`main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in
`start'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:
209:in `start'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in
`spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:
126:in `lookup_or_add'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in
`spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:
80:in `synchronize'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:
79:in `synchronize'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in
`spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in
`spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in
`handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in
`__send__'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in
`main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
  /usr/lib/phusion_passenger/passenger-spawn-server:61

*note*
I have done some digging, and one forum suggests:

Open base.rb in ActionMailer and comment the following line:

smtp.enable_starttls_auto if smtp.respond_to?(:enable_starttls_auto)

However, I have another app on the same server that runs and sends
mail fine. So i don't tink i need to change this..

Can anyone please help??

Many Thanks

Hello,

I have an application that, when you create an appointment it sends an
email to the client to say someone has just booked.

Locally, this works fine (i'm just using sendmail)

Locally - all email tests have come through - no problem.

However - when I copy all the files onto the server and attempt to
create a booking, it comes up with the 500 page. The error below if
taken from my server logs:

Please NOte - I have another site which uses the same sendmail
functionality, and i've never had a problem.

Any ideas?

It's complaining that the ssl certificate that the smtp server is
using is for a different host.

Fred

re: It's complaining that the ssl certificate that the smtp server is
using is for a different host.

how do I change this then?

It works fine on my other app that runs on the same server....

sorted.

i just needed the sendmail referenc in the production.rb file.

works fine now.

thanks Frederick