Here\'s my simple test program (using ActionMailer 3.0.8, Ruby 1.9.2p180 Mac OS X):
require \'rubygems\'
require \'action_mailer\'
ActionMailer::Base.delive
It could be: none, plain, login, cram_md5, NTLM, StartTLS
250-AUTH LOGIN
" or "250-AUTH=LOGIN
" indicate that you need to authenticate.250-AUTH
" (with nothing else following on that line!) seems to indicate that you should NOT authenticate yourself! Otherwise you will get the error:
Good resources that should help you to understand and troubleshoot it.
(instead of changing how you access Exchange)
Helpful for Ruby on Rails
had similar network issues. use the code below in irb
to get debug info right in the console.
require 'net/smtp'
smtp = Net::SMTP.new('ip_or_dns_address', port)
smtp.debug_output = $stdout
smtp.enable_starttls_auto#skip if not needed
smtp.start("domain", "user", "password", auth_type)
never really found out what the issue was. they moved the exchange server and the production server stopped sending emails. im not really an IT guy but there were different debug logs depending which part of the network i was on. finally "solved" the problem by sending unauthenticated email...
You could connect to the SMTP server and query the supported authentication methods:
telnet smtp.server.net 25
EHLO
The server should respond with at least one line that starts with 250-AUTH
. After that the supported authentication methods are listed. Chances are that the Exchange server only supports authentication via GSSAPI or NTLM. In the latter case you might be able to get it to work with the ruby-ntlm gem and the ntlm
authentication method. (See http://www.breckenedge.com/configuration-of-ruby-on-rails-actionmailer-for-microsoft-exchange-smtp)