504 Unrecognized authentication type

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
1/19/2008 5:10:26 PM
Gravatar
Total Posts 112

504 Unrecognized authentication type

Hi Joe;

I'm getting the System Log error "504 Unrecognized authentication type" when I try to Send a Newsletter. I don't think it's a Newsletter problem, I think I've buggered up my SMTP settings, somehow. I've used the web.config setting values in other c# code and it was able to send email without problem. (UseDefaultCredentials appears to a property in System.Net.Mail.SmtpClient that is required for Google email; but, I don't see it available in web.config.)

System Log error:

2008-01-19 10:53:56,045 [5572] ERROR mojoPortal.Business.LetterSendTask [(null)] - 504 Unrecognized authentication type

Key parts of web.config:

<add key="SMTPServer" value="smtp.gmail.com" />
<add key="SMTPRequiresAuthentication" value="true" />
<add key="SMTPUseSsl" value="true" />
<add key="SMTPPort" value="587" />
<add key="SMTPUser" value="MooreWorksService@gMail.Com" />
<add key="SMTPPassword" value="foo" />
<add key="SMTPTimeoutInMilliseconds" value="15000" />
<add key="DefaultEmailFrom" value="DaleEMoore@gMail.Com" />
<add key="WebMaster" value="DaleEMoore@gMail.Com" />

and further down for PasswordRecovery must be in web.config and will be overwritten on next upgrade of MP:

<system.net>
<mailSettings>
<smtp from="DaleEMoore@gMail.Com">
<network
host="smtp.gmail.com"
port="587"
password="foo"
userName="MooreWorksService@gMail.Com"
defaultCredentials="false"
/>
</smtp>
</mailSettings>
</system.net>

Any help you can provide is very much appreciated,
Dale E. Moore
 

1/19/2008 5:24:27 PM
Gravatar
Total Posts 18439

Re: 504 Unrecognized authentication type

Hi Dale,

Its true you need to backup your web.config and restore customizations after an upgrade.

You can reduce the effort by putting any customizations from the appSettings section in a user.config file. In the source code at the root of the web is a user.config.sample file that you can open and save as user.config then put your appSettings customizations there and you won't have to worry about losing those settings.

Of couse other sections like the system.net section you still have to re-apply your customizations.

Be aware however, when you make a change in user.config the system won't detect it automatically so you have to touch the Web.confiig file by opening it type a space and save. This will make it reload all settings including your user.config.

To troubleshoot I would use a Cpontact Form module and tweak your settings until it works. First thing I would try is set SMTPUseSsl to false. I know yahoo says to use sssl but in my trials it didn't work with this set to true, so gmail may be the same.

The system.net section smtp settings are only used by built in .NET controls like PasswordRecovery. All the custom features use the appSettings section settings.

Hope it helps,

Joe

1/21/2008 2:52:07 PM
Gravatar
Total Posts 112

Re: 504 Unrecognized authentication type

The Contact form tells me "Thank You! Your message has been sent." But no message is ever received at the destination. I wrote a little code to run on the same server and see if I could figure out why the message was never received... Perhaps the server didn't send it. But my code sends the email...

Code to send test email:

System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add(ToTextBox1.Text);
message.Subject = SubjectTextBox1.Text;
message.From = new System.Net.Mail.MailAddress(FromTextBox1.Text);
message.Body = "test";
message.IsBodyHtml = IsHTMLCheckBox1.Checked ? true : false;

System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(HostTextBox1.Text, Convert.ToInt32(PortTextBox1.Text));
System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential(UserNameTextBox1.Text, PasswordTextBox1.Text);
smtp.UseDefaultCredentials = UseDefaultCredentialsCheckBox1.Checked ? true : false;
smtp.EnableSsl = EnableSSLCheckBox1.Checked ? true : false;
smtp.Credentials = SMTPUserInfo;
s1 = message.Body;
try
{
smtp.Send(message);
StatusTextBox1.Text = "OK";
}
catch (Exception ex)
{
StatusTextBox1.Text = ex.ToString();
}
message.Dispose(); // Free up the attachment once sent.

Form parameters:

Host: mail.mooreworks.net
Port: 25
Username: mworks@mooreworks.net
Use Default Credentials: True
Enable SSL: False
From: DaleEMoore@gMail.Com
To: DaleEMoore@gMail.Com
Subject: c2 smtpTest1
Is HTML: False
 

1/21/2008 4:05:58 PM
Gravatar
Total Posts 18439

Re: 504 Unrecognized authentication type

Look in the mojoportal system log and you should see error messages if it failed to send.

Joe

1/21/2008 5:01:08 PM
Gravatar
Total Posts 112

Re: 504 Unrecognized authentication type

I cleared the System Log before running the Contact form and afterwards there are no entries in the system log and the Contact form says "Thank You! Your message has been sent."

 

 

 

1/22/2008 1:03:15 PM
Gravatar
Total Posts 112

Re: 504 Unrecognized authentication type

Hi Joe;

In Web.config after "</configSections>" I inserted:

<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Net" >
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
<source name="System.Net.Sockets">
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add
name="MyTraceFile"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="c:\System.Net.trace.log" />
</sharedListeners>
<switches>
<add name="System.Net" value="Verbose" />
<add name="System.Net.Sockets" value="Verbose" />
</switches>
</system.diagnostics>

and got:

System.Net.Sockets Verbose: 0 : [4364] SmtpProxy#28145867::TcpClient(InterNetwork#2)
System.Net.Sockets Verbose: 0 : [4364] Socket#58604500::Socket(InterNetwork#2)
System.Net.Sockets Verbose: 0 : [4364] Exiting Socket#58604500::Socket()
System.Net.Sockets Verbose: 0 : [4364] Exiting SmtpProxy#28145867::TcpClient()
System.Net.Sockets Verbose: 0 : [4364] SmtpProxy#28145867::TcpClient()
System.Net.Sockets Verbose: 0 : [4364] Exiting SmtpProxy#28145867::TcpClient()
System.Net.Sockets Verbose: 0 : [4364] DNS::GetHostEntry(mail.mooreworks.net)
System.Net.Sockets Verbose: 0 : [4364] DNS::GetHostByName(mail.mooreworks.net)
System.Net.Sockets Verbose: 0 : [4364] Exiting DNS::GetHostByName() -> IPHostEntry#19956848
System.Net.Sockets Verbose: 0 : [4364] Exiting DNS::GetHostEntry() -> IPHostEntry#19956848
System.Net.Sockets Verbose: 0 : [4364] SmtpProxy#28145867::Connect(4:25#69166143)
System.Net.Sockets Verbose: 0 : [4364] Socket#58604500::Connect(4:25#69166143)
System.Net.Sockets Error: 0 : [4364] Exception in the Socket#58604500::Connect - No connection could be made because the target machine actively refused it 38.100.31.4:25
System.Net.Sockets Verbose: 0 : [3456] Socket#58604500::Dispose()
System.Net.Sockets Verbose: 0 : [3456] SmtpProxy#28145867::Dispose()
System.Net.Sockets Verbose: 0 : [3456] Exiting SmtpProxy#28145867::Dispose()

Though Contact Form still said "Thank You! Your message has been sent."

Now I'll start trying different connection options, and different mail hosts to see which works for me.

Thanks,
Dale

1/22/2008 4:10:16 PM
Gravatar
Total Posts 112

Re: 504 Unrecognized authentication type

I'm hoping that you (careful reader) will have some insight into this oddity; none of my searches have brought me any insight. I'm trying to turn on web.config system.diagnostics on my production machine as I mentioned in a previous post which works on my development machine. But I am unable to get any logging, or even create the log file.

I moved the <system.diagnostics> section to before <configSections> and got the normal error, so I know I'm fiddling with the correct web.config file. I've created the c:\System.Net.trace.log and granted everyone full access, but; no logging entries ever appear.

Any suggestions you have are very much appreciated,
Dale E. Moore

1/23/2008 5:34:41 AM
Gravatar
Total Posts 18439

Re: 504 Unrecognized authentication type

Hi Dale,

It will show the message sent message and just log it if it catches a MailException or a SocketException

try
{
mail.Send(smtpServer);
}
catch (MailException ex)
{
log.Error("error sending email, message was: " + messageBody, ex);
}
catch (SocketException ex)
{
log.Error("error sending email, message was: " + messageBody, ex);
}

So don't go by that message. The error may not appear immediately in the log, it may be bufferred in memory for a while and written to the log in batches to avoid file IO contention. You may want to review your log4net.config file.

The error you are getting indicates the server refused actively the connection. This means something isn't right in your configuratioon or credentials.

In the future I plan to add a db table to the contact form feature and capture all messages there and make a web page to review them. That way even if smtp fails the message wil be accessible.

 

Joe

1/23/2008 11:02:07 AM
Gravatar
Total Posts 112

Re: 504 Unrecognized authentication type

Thanks everyone (Joe:):

I was never successfull with Google's smtp.gmail.com:( But a different email server is working fine for me now. I was surprised to discover that the Contact Form, Feature Instance Settings, e-mail address MUST be correct also or authentication fails.

Metta,
Dale E. Moore

12/19/2008 8:18:02 AM
Gravatar
Total Posts 8

Re: 504 Unrecognized authentication type

I am getting exactly the same error message when trying to send emails using Gmail.The same setttings and account works for a DNN installation and BlogEngine.Net. Unfornately, my SMTP host is clamping down on # of messages sent from my virtual host per day to fight SPAM. So GMail was my last hope. Anyone got Gmail to work with Mojo? Thanks!

12/19/2008 8:19:18 AM
Gravatar
Total Posts 8

Re: 504 Unrecognized authentication type

Sorry, forgot to include the error message from the log.

Error message from the log: 2008-12-19 09:01:10,697 ERROR mojoPortal.Web.ContactUI.ContactForm - 504 Unrecognized authentication type

You must sign in to post in the forums. This thread is closed to new posts.