public void TestDKIMSpecificMessage() { hMailServer.AntiSpam antiSpam = _application.Settings.AntiSpam; string folderGood = Path.GetFullPath("../../../TestData/DKIM/Good"); string path = Path.Combine(Environment.CurrentDirectory, folderGood); string file = Path.Combine(path, "a.txt"); DeleteCurrentLog(); hMailServer.eDKIMResult result = antiSpam.DKIMVerify(file); Assert.AreEqual(hMailServer.eDKIMResult.eDKPass, result, file); Assert.IsTrue(VerifyLoadSuccess()); }
public void TestDKIMMissingBH() { hMailServer.AntiSpam antiSpam = _application.Settings.AntiSpam; string folderMissingBH = Path.GetFullPath("../../../TestData/DKIM/Neutral - Missing bodyhash"); string path = Path.Combine(Environment.CurrentDirectory, folderMissingBH); string[] files = Directory.GetFiles(path); foreach (string file in files) { hMailServer.eDKIMResult result = antiSpam.DKIMVerify(file); Assert.AreEqual(hMailServer.eDKIMResult.eDKNeutral, result, file); } }
public void TestDKIMBadSignature() { hMailServer.AntiSpam antiSpam = _application.Settings.AntiSpam; string folder = Path.GetFullPath("../../../TestData/DKIM/PermFail"); string path = Path.Combine(Environment.CurrentDirectory, folder); string[] files = Directory.GetFiles(path); foreach (string file in files) { DeleteCurrentLog(); hMailServer.eDKIMResult result = antiSpam.DKIMVerify(file); Assert.AreEqual(hMailServer.eDKIMResult.eDKPermFail, result, file); Assert.IsFalse(VerifyLoadSuccess()); } }
public void TestDKIMMassTest() { int verificationCount = 5000; hMailServer.AntiSpam antiSpam = _application.Settings.AntiSpam; string folderGood = Path.GetFullPath("../../../TestData/DKIM/Good"); string goodFile = Directory.GetFiles(folderGood)[0]; for (int i = 0; i < verificationCount; i++) { DeleteCurrentLog(); hMailServer.eDKIMResult result = antiSpam.DKIMVerify(goodFile); Assert.AreEqual(hMailServer.eDKIMResult.eDKPass, result, goodFile); Assert.IsTrue(VerifyLoadSuccess()); } }
public void TestDKIMUnsupported() { hMailServer.AntiSpam antiSpam = _application.Settings.AntiSpam; string folder = Path.GetFullPath("../../../TestData/DKIM/Unsupported"); string path = Path.Combine(TestContext.CurrentContext.TestDirectory, folder); string[] files = Directory.GetFiles(path); foreach (string file in files) { DeleteCurrentLog(); hMailServer.eDKIMResult result = antiSpam.DKIMVerify(file); Assert.AreEqual(hMailServer.eDKIMResult.eDKNeutral, result, file); Assert.IsFalse(VerifyLoadSuccess()); } }
public void TestDKIMGood() { hMailServer.AntiSpam antiSpam = _application.Settings.AntiSpam; string folderGood = Path.GetFullPath("../../../TestData/DKIM/Good"); string path = Path.Combine(TestContext.CurrentContext.TestDirectory, folderGood); string[] files = Directory.GetFiles(folderGood); foreach (string file in files) { DeleteCurrentLog(); Console.WriteLine(string.Format("Testing file {0}...", file)); hMailServer.eDKIMResult result = antiSpam.DKIMVerify(file); Assert.AreEqual(hMailServer.eDKIMResult.eDKPass, result, file); Assert.IsTrue(VerifyLoadSuccess()); } }