We have been using YAFNet for more than two years now.
For some reason, we upgraded to today.
A decent number of users have "email notification" enabled and watch at forums or topics.
For years, this has been working like a charm: as soon as a post or topic is created, YAFNet used to send notification emails, via an SMTP server installed on the same machine (a great open source solution named hMailServer , which we also use with our email marketing; it is capable of sending hundreds of emails per minute.

Now, since we upgraded to, we see that, as soon as there are just of few notification emails to be sent (let's say: half a dozen), YAFNet seems to try opening many SMTP connections with our SMTP server, which eventually gives up and returns a message like this:

Client connection from was not accepted. Blocked either by IP range or by connection limit

Obviously, the trouble maker is not the IP range 😀
At the same time, there's a "nice" ASP error on the client side, with messages like this:

[IOException: Impossible de lire les données de la connexion de transport : net_io_connectionclosed.]
System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) +704
System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) +297
System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) +25
System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) +775
System.Net.Mail.SmtpClient.GetConnection() +56
System.Net.Mail.SmtpClient.Send(MailMessage message) +2164

[SmtpException: Échec d'envoi du courrier.]
System.Net.Mail.SmtpClient.Send(MailMessage message) +3250
YAF.Core.Services.SendMail.SendAll(IEnumerable`1 messages, Action`2 handleException) +302
YAF.Core.Services.TemplateEmail.SendEmail(MailAddress fromAddress, MailAddress toAddress, String subject) +197
YAF.Core.Services.<>c__DisplayClass10_0.<ToWatchingUsers>b__2(User user) +443
System.Linq.Parallel.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey) +104
System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork() +57
System.Linq.Parallel.SpoolingTaskBase.Work() +232
System.Linq.Parallel.QueryTask.BaseWork(Object unused) +81
System.Threading.Tasks.Task.Execute() +71

[AggregateException: Une ou plusieurs erreurs se sont produites.]
System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose) +502
System.Linq.Parallel.DefaultMergeHelper`2.System.Linq.Parallel.IMergeHelper<TInputOutput>.Execute() +183
System.Linq.Parallel.MergeExecutor`1.Execute(PartitionedStream`2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId) +544
System.Linq.Parallel.PartitionedStreamMerger`1.Receive(PartitionedStream`2 partitionedStream) +131
System.Linq.Parallel.ForAllOperator`1.WrapPartitionedStream(PartitionedStream`2 inputStream, IPartitionedStreamRecipient`1 recipient, Boolean preferStriping, QuerySettings settings) +409
System.Linq.Parallel.ChildResultsRecipient.Receive(PartitionedStream`2 inputStream) +197
System.Linq.Parallel.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient) +189
System.Linq.Parallel.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient) +680
System.Linq.Parallel.QueryOperator`1.GetOpenedEnumerator(Nullable`1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings) +574
System.Linq.Parallel.ForAllOperator`1.RunSynchronously() +316
YAF.Core.Services.SendNotification.ToWatchingUsers(Int32 newMessageId) +1393
YAF.Pages.PostTopic.PostReply_Click(Object sender, EventArgs e) +3697
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1964

"Impossible de lire les données de la connexion de transport " means "Unable to read transport connection data".
"SmtpException: Échec d'envoi du courrier." means "Email send failed".

Over the 6-7 emails, which were due to be sent, only 4-5 succeed.

As everything was still working fine this morning (with, and as this SMTP Server is also used for Marketing purpose, without making any problem, I suppose that this behavior change is due to our upgrade.

  • is this situation well known?
  • is there by any chance a way to limit the number of concurrent SMTP connections, opened by YAFNet?


Kind regards,

I uploaded version 2.31.04 

You only need to replace the bin folder.

The issue should be fixed. Please let me know if it works now.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved