rnwood / smtpserver Goto Github PK
View Code? Open in Web Editor NEWA SMTP server component for .NET Framework and .NET Core.
License: BSD 3-Clause "New" or "Revised" License
A SMTP server component for .NET Framework and .NET Core.
License: BSD 3-Clause "New" or "Revised" License
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
xunit
, xunit.runner.visualstudio
)Microsoft.Extensions.Logging
, Microsoft.Extensions.Logging.Abstractions
)Rnwood.SmtpServer.Tests/Rnwood.SmtpServer.Tests.csproj
Xunit.SkippableFact 1.4.13
MailKit 2.5.2
Moq 4.20.70
xunit 2.7.0
System.Net.Security 4.3.2
System.Collections.NonGeneric 4.3.0
xunit.runner.visualstudio 2.5.7
NETStandard.Library 2.0.3
Microsoft.NET.Test.Sdk 17.9.0
FluentAssertions 6.12.0
Rnwood.SmtpServer/Rnwood.SmtpServer.csproj
System.Net.Security 4.3.2
System.Collections.NonGeneric 4.3.0
Microsoft.Extensions.Logging.Abstractions 3.1.32
Microsoft.Extensions.Logging 2.2.0
Microsoft.CodeAnalysis.CSharp 4.9.2
Over at NuGet, every single version since 2.0.5.1 is treated as a prerelease build, which would suggest that this package has not had a stable release in over 10 years.
This is because it includes a prerelease suffix as per paragraph 9 of the Semantic Versioning specification.
I suggest either removing the suffix entirely, or changing the final -
to a +
to mark it as Build Metadata instead as per paragraph 10 of the spec.
Hello,
I have problems with Authorization (I'm using MailKit as client). I get the following exception:
System.NotSupportedException: 'No compatible authentication mechanisms found.'
By looking at source code I see in Rnwood.SmtpServer\Extensions\Auth\AuthExtensionProcessor.cs:GetEHLOKeywords() that list of available auth methods is created by joining full names of IAuthMechanism classes, not a IAuthMechanism.Identifier. It should be something simmilar to:
string mids = string.Join(" ", mechanisms.Select( am => am.Identifier ).ToArray() );
I'm using latest prerelease nuget (3.1.0-ci0466).
If client sends an 8 bit message without using 8BITIME (which implies UTF-8) then the encoding is changed into UTF8 in the received message bytes.
Repro:
using System.Net.Mail;
using System.Net.Mime;
using System.Text;
var smtpClient = new SmtpClient("localhost")
{
Port = 25,
};
var mailMessage = new MailMessage
{
From = new MailAddress("[email protected]"),
Subject = "Latin test",
//BodyTransferEncoding = TransferEncoding.,
Body =
"<span>Homines in indicaverunt nam purus quáestionem sentiri unum. Afflueret contentus diam errore faciam, honoris mucius omnem pélléntésqué reiciendis. Acuti admissum arbitrantur concederetur dediti, ferrentur fugiendus inferiorem peccant ponti quando solam ullius. áb atilii concursio constituamus, définitioném diligenter graeci illam máius operis opinionum pótióne versatur. Alliciat aspernari consoletur disserunt, impendere interiret reliquarum verum. Convállis essent foedus gravida iustioribus, mox notissima perpaulum praeclare probatum, prohiberet sensibus. Condimentum efficeretur iis insipientiam, inutile logikh ne ornare, paulo primis primo pugnare putarent quiddam reperiuntur. \r\nCéramico cónsistat éiusdém licet offendimur, recusandae referendá. Cupiditatés hónesta musicis possent, respondendum sollicitudines. Breviter democrito dolor electram illa, ludicra non occulta pérféréndis principio servare suum tranquillitatem. Consentinis probatus qualisque tollatur veritatis. In inséquitur ortum pertinaces, sentit stoici sum téréntii.</span>",
BodyEncoding = Encoding.Latin1,
BodyTransferEncoding = TransferEncoding.EightBit,
IsBodyHtml = true,
};
mailMessage.To.Add("[email protected]");
smtpClient.Send(mailMessage);
We're facing a (rare) race condition in Rnwood.SmtpServer.SmtpServer.KillConnections
:
System.InvalidOperationException : Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Linq.Enumerable.CastIterator[TResult](IEnumerable source)+MoveNext()
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
at Rnwood.SmtpServer.SmtpServer.KillConnections()
at Rnwood.SmtpServer.SmtpServer.Stop(Boolean killConnections)
at Rnwood.SmtpServer.SmtpServer.Stop()
at Rnwood.SmtpServer.SmtpServer.Dispose(Boolean disposing)
at Rnwood.SmtpServer.SmtpServer.Dispose()
at Octopus.IntegrationTests.Core.EmailSending.SmtpClientWrapperFixture.WhenSendingAnEmailToAServerWithNoTls_TheEmailShouldBeAccepted() in /opt/buildagent/work/abb2fbfce959a439/source/Octopus.IntegrationTests/Core/EmailSending/SmtpClientWrapperFixture.cs:line 44
at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaitable)
at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()
------- Stdout: -------
11/30/2020 9:33:24 PM 34 Trace Connected to SMTP server smtp://localhost:37175/?starttls=when-available
11/30/2020 9:33:24 PM 34 Trace SMTP received: 220 ip-10-10-11-232 smtp4dev ready
11/30/2020 9:33:24 PM 34 Trace SMTP sent: EHLO [127.0.0.1]
11/30/2020 9:33:24 PM 34 Trace SMTP received: 250-Nice to meet you.
250-8BITMIME
250-SIZE
250 SMTPUTF8
11/30/2020 9:33:24 PM 28 Trace SMTP sent: MAIL FROM:<[email protected]>
11/30/2020 9:33:24 PM 28 Trace SMTP received: 250 New message started
11/30/2020 9:33:24 PM 32 Trace SMTP sent: RCPT TO:<[email protected]>
11/30/2020 9:33:24 PM 31 Trace SMTP received: 250 Recipient accepted
11/30/2020 9:33:24 PM 32 Trace SMTP sent: DATA
11/30/2020 9:33:24 PM 32 Trace SMTP received: 354 End message with period
11/30/2020 9:33:24 PM 32 Trace SMTP sent: From: [email protected]
To: [email protected]
Subject: Test subject
Date: Mon, 30 Nov 2020 21:33:24 +1000
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
11/30/2020 9:33:24 PM 32 Trace SMTP sent:
Test body
11/30/2020 9:33:24 PM 28 Trace SMTP sent:
.
11/30/2020 9:33:24 PM 12 Trace SMTP received: 250 Mail accepted
11/30/2020 9:33:24 PM 34 Trace SMTP sent: QUIT
11/30/2020 9:33:24 PM 12 Trace SMTP received: 221 Goodbye
This is pretty rare:
(first one is testing async, second is testing sync)
Let me know if you want to see the tests/code in question - I dont think it's too important here.
Looking into the code, i think this line is causing the error. Even though activeConnections
is a synchronized list, it's not threadsafe for enumeration. Looking at the docs, it seems the code needs to lock on the SyncRoot property before enumeration:
lock(myCollection.SyncRoot)
{
foreach (object item in myCollection)
{
// Insert your code here.
}
}
Would you be willing to accept a PR that changes this?
Ability to configure the list of supported Auth mechanisms when configuring the SmtpServer.
Such as to support scenarios listed here rnwood/smtp4dev#852
I developed a small SMTP-Server which is used to receive mails sent by my China-built cameras for wild watching. They sent two kinds of mails and I wrote an dotnet application which works on my windows server without any problem.
Because I want to have the windows server as a development server reachable also from my Mac I have deployed the complete solution to a standard Ubuntu 20.x powered V-Server.
The camera is working as expected, as when I will send the mail to the Windows server but much slower. But it states that the mail was sent without any errors.
But on the console I see only that the start and end events are fired. The Auth-Event and also the main receive-Event ist not fired.
I can provide you access to my git or even sent mails to a server on which you can try to receive the message.
Hello,
Do you have any contact info? just want to ask you some questions, if that's possible.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.