コード例 #1
0
        public void TestAntiVirusDisabled()
        {
            List <string> messages = new List <string>();

            string messageText = "From: [email protected]\r\n" +
                                 "To: [email protected]\r\n" +
                                 "Subject: Test\r\n" +
                                 "\r\n" +
                                 "Should be blocked by SPF.";

            messages.Add(messageText);

            int        port       = 1110;
            POP3Server pop3Server = new POP3Server(1, port, messages);

            pop3Server.StartListen();

            hMailServer.Account account = SingletonProvider <Utilities> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            hMailServer.FetchAccount fa = CreateFetchAccount(account, port, false, false);

            fa.DownloadNow();

            pop3Server.WaitForCompletion();

            fa.Delete();

            POP3Simulator.AssertMessageCount(account.Address, "test", 1);

            hMailServer.Message message = account.IMAPFolders.get_ItemByName("INBOX").Messages[0];
            Assert.IsFalse(message.get_Flag(hMailServer.eMessageFlag.eMFVirusScan));
        }