Discussion:
Can't authenticate with mail server
Jerry Seutter
2008-02-26 22:16:32 UTC
Permalink
Hi,

I am having difficulty sending notification emails through a mail server.
Here is the trace output:

Build 19829.2 FAILED
-> "220 smtp.xxx.com Microsoft ESMTP MAIL Service, Version:
6.0.3790.1830ready at Tue, 26 Feb 2008 14:43:52 -0700 \r\n"
<- "EHLO xxx.com\r\n"
-> "250-smtp.xxx.com Hello [172.16.2.27]\r\n"
-> "250-TURN\r\n"
-> "250-SIZE\r\n"
-> "250-ETRN\r\n"
-> "250-PIPELINING\r\n"
-> "250-DSN\r\n"
-> "250-ENHANCEDSTATUSCODES\r\n"
-> "250-8bitmime\r\n"
-> "250-BINARYMIME\r\n"
-> "250-CHUNKING\r\n"
-> "250-VRFY\r\n"
-> "250-X-EXPS GSSAPI NTLM LOGIN\r\n"
-> "250-X-EXPS=LOGIN\r\n"
-> "250-AUTH GSSAPI NTLM LOGIN\r\n"
-> "250-AUTH=LOGIN\r\n"
-> "250-X-LINK2STATE\r\n"
-> "250-XEXCH50\r\n"
-> "250 OK\r\n"
<- "STARTTLS\r\n"
-> "554 5.7.3 Unable to initialize security subsystem\r\n"
-> "220 smtp.xxx.com Microsoft ESMTP MAIL Service, Version:
6.0.3790.1830ready at Tue, 26 Feb 2008 14:43:52 -0700 \r\n"
<- "EHLO pason.com\r\n"
-> "250-smtp.xxx.com Hello [172.16.2.27]\r\n"
-> "250-TURN\r\n"
-> "250-SIZE\r\n"
-> "250-ETRN\r\n"
-> "250-PIPELINING\r\n"
-> "250-DSN\r\n"
-> "250-ENHANCEDSTATUSCODES\r\n"
-> "250-8bitmime\r\n"
-> "250-BINARYMIME\r\n"
-> "250-CHUNKING\r\n"
-> "250-VRFY\r\n"
-> "250-X-EXPS GSSAPI NTLM LOGIN\r\n"
-> "250-X-EXPS=LOGIN\r\n"
-> "250-AUTH GSSAPI NTLM LOGIN\r\n"
-> "250-AUTH=LOGIN\r\n"
-> "250-X-LINK2STATE\r\n"
-> "250-XEXCH50\r\n"
-> "250 OK\r\n"
<- "AUTH PLAIN AGRoZW1haWwAfng2PGo8Xxx=\r\n"
-> "504 5.7.4 Unrecognized authentication type.\r\n"

I have verified the username, password and hostname.

The server is not using TLS. Why is cruisecontrol issuing STARTTLS?

Here is the relevant section from my site_config.rb:

ActionMailer::Base.smtp_settings = {
:address => "smtp.int.xxx.com",
:port => 25,
:domain => "xxx.com",
:authentication => :plain,
:user_name => "yyyyyyyy",
:password => "xxxxxxxx",
}


The behaviour is the same with cruisecontrolrb 1.2.1 and trunk.

Any ideas?

Jerry Seutter
Alexey Verkhovsky
2008-02-27 21:20:08 UTC
Permalink
Post by Jerry Seutter
I am having difficulty sending notification emails through a mail server.
<- "AUTH PLAIN AGRoZW1haWwAfng2PGo8Xxx=\r\n"
-> "504 5.7.4 Unrecognized authentication type.\r\n"
Awesome. The way I read it, your Microsoft Exchange Server is
configured to not accept AUTH PLAIN. Try to add :authentication =>
:login to ActionMailer::Base.smtp_settings hash. If I read the
ActionMailer and Net::SMTP code correctly, this should make CC.rb use
AUTH LOGIN instead of AUTH PLAIN.

Re STARTTLS. CC.rb (trunk) monkey-patches Net::SMTP to try and open a
TLS connection. If server responds with an error code, CC.rb restarts
the SMTP conversation from scratch (literally, closes the socket,
opens another one, says EHLO again etc).

Reasons:
1. We want to TLS because GMail SMTP server requires it.
2. Some old SMTP servers that don't have TLS drop the connection after
rejecting STARTTLS.
--
Alexey Verkhovsky
CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com]
RubyWorks [http://rubyworks.thoughtworks.com]
Loading...