Пример #1
0
        public void TestNestedOrSearch()
        {
            Application application = SingletonProvider <TestSetup> .Instance.GetApp();


            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send("*****@*****.**", "*****@*****.**", "Search test", "This is a test of IMAP Search");

            IMAPClientSimulator.AssertMessageCount(oAccount.Address, "test", "Inbox", 1);

            var    oSimulator      = new IMAPClientSimulator();
            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            oSimulator.SelectFolder("INBOX");

            string result =
                oSimulator.SendSingleCommand("A4 SEARCH ALL OR OR SINCE 28-May-2008 SINCE 28-May-2008 SINCE 28-May-2008");

            CustomAssert.IsTrue(result.StartsWith("* SEARCH 1"), result);

            result = oSimulator.SendSingleCommand("A4 SEARCH ALL OR SMALLER 1 LARGER 10000");
            CustomAssert.IsTrue(result.StartsWith("* SEARCH\r\n"), result);

            result = oSimulator.SendSingleCommand("A4 SEARCH ALL OR OR SMALLER 1 LARGER 10000 SMALLER 10000");
            CustomAssert.IsTrue(result.StartsWith("* SEARCH 1\r\n"), result);
        }
Пример #2
0
        public void TestSearchON()
        {
            Application application = SingletonProvider <TestSetup> .Instance.GetApp();


            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send("*****@*****.**", "*****@*****.**", "Search test", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 1);

            var oSimulator = new IMAPClientSimulator();

            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            string formattedTomorrow =
                (DateTime.Now + new TimeSpan(1, 0, 0, 0)).ToString("dd-MMM-yyyy", CultureInfo.InvariantCulture).ToUpper();
            string formattedToday = DateTime.Now.ToString("dd-MMM-yyyy", CultureInfo.InvariantCulture).ToUpper();

            if (oSimulator.Search("ON " + formattedTomorrow) != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            if (oSimulator.Search("ON " + formattedToday) != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }
        }
Пример #3
0
        public void TestSearchOR()
        {
            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send("*****@*****.**", "*****@*****.**", "Search test", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 1);

            var oSimulator = new IMAPClientSimulator();

            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            CustomAssert.AreEqual("1", oSimulator.Search("OR SINCE 28-May-2001 ON 28-May-2001 ALL"));
            CustomAssert.IsNullOrEmpty(oSimulator.Search("OR SINCE 28-May-2020 ON 28-May-2012 ALL"));

            string formattedToday = DateTime.Now.ToString("dd-MMM-yyyy", CultureInfo.InvariantCulture).ToUpper();

            CustomAssert.AreEqual("1", oSimulator.Search("OR SINCE 28-May-2017 ON " + formattedToday + " ALL"));

            string formatted2001 = new DateTime(2001, 01, 01).ToString("dd-MMM-yyyy").ToUpper();

            CustomAssert.AreEqual("1", oSimulator.Search("OR SINCE 28-May-2008 ON " + formatted2001 + " ALL"));
        }
Пример #4
0
        public void TestSubjectSearchMultipleMatches()
        {
            Domain  oDomain  = _application.Domains[0];
            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send("*****@*****.**", "*****@*****.**", "Test1", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 1);
            oSMTP.Send("*****@*****.**", "*****@*****.**", "TestA", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 2);
            oSMTP.Send("*****@*****.**", "*****@*****.**", "Test1", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 3);

            var oSimulator = new IMAPClientSimulator();

            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            CustomAssert.AreEqual("1 3", oSimulator.Sort("(SUBJECT) UTF-8 ALL HEADER SUBJECT \"Test1\""));
            CustomAssert.AreEqual("2", oSimulator.Sort("(SUBJECT) UTF-8 ALL HEADER SUBJECT \"TestA\""));
            CustomAssert.AreEqual("3 1", oSimulator.Sort("(REVERSE SUBJECT) UTF-8 ALL HEADER SUBJECT \"Test1\""));
            CustomAssert.AreEqual("2", oSimulator.Sort("(REVERSE SUBJECT) UTF-8 ALL HEADER SUBJECT \"TestA\""));
            CustomAssert.AreEqual("3 1", oSimulator.Sort("(REVERSE SUBJECT) UTF-8 ALL (HEADER SUBJECT) \"Test1\""));
            CustomAssert.AreEqual("2", oSimulator.Sort("(REVERSE SUBJECT) UTF-8 ALL (HEADER SUBJECT) \"TestA\""));
        }
Пример #5
0
        public void TestMediumVolume()
        {
            // Fetch default domain
            Application application = SingletonProvider <TestSetup> .Instance.GetApp();

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            var oSMTP = new SMTPClientSimulator();


            var oThreads = new ArrayList();

            for (int i = 0; i < 5; i++)
            {
                var oThread = new Thread(Send50Messages);
                oThreads.Add(oThread);
                oThread.Start();
            }

            // Join the threads
            for (int i = 0; i < 5; i++)
            {
                var oThread = (Thread)oThreads[i];
                oThread.Join();
            }

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 250);
        }
Пример #6
0
        public void TestSortSubjectSearch()
        {
            Domain  oDomain  = _application.Domains[0];
            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send("*****@*****.**", "*****@*****.**", "aa", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 1);
            oSMTP.Send("*****@*****.**", "*****@*****.**", "bb", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 2);

            var    oSimulator      = new IMAPClientSimulator();
            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            CustomAssert.AreEqual("1 2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR HEADER SUBJECT aa HEADER SUBJECT bb"));
            CustomAssert.AreEqual("1 2",
                                  oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR (HEADER SUBJECT aa) (HEADER SUBJECT bb)"));
            CustomAssert.AreEqual("1 2",
                                  oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED (OR HEADER SUBJECT aa HEADER SUBJECT bb)"));

            CustomAssert.AreEqual("1", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR HEADER SUBJECT aa HEADER SUBJECT cc"));
            CustomAssert.AreEqual("1",
                                  oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR (HEADER SUBJECT aa) (HEADER SUBJECT cc)"));
            CustomAssert.AreEqual("1", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED (OR HEADER SUBJECT aa HEADER SUBJECT cc)"));

            CustomAssert.AreEqual("2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR HEADER SUBJECT bb HEADER SUBJECT cc"));
            CustomAssert.AreEqual("2",
                                  oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR (HEADER SUBJECT bb) (HEADER SUBJECT cc)"));
            CustomAssert.AreEqual("2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED (OR HEADER SUBJECT bb HEADER SUBJECT cc)"));
        }
Пример #7
0
        public void TestSortReverseSize()
        {
            Domain  oDomain  = _application.Domains[0];
            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            var longBodyString = new StringBuilder();

            longBodyString.Append('A', 10000);

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send("*****@*****.**", "*****@*****.**", "Test1", longBodyString.ToString());
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 1);

            oSMTP.Send("*****@*****.**", "*****@*****.**", "Test2", "Test body");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 2);

            var oSimulator = new IMAPClientSimulator();

            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            CustomAssert.AreEqual("2 1", oSimulator.Sort("(SIZE) UTF-8 ALL"));
            CustomAssert.AreEqual("1 2", oSimulator.Sort("(REVERSE SIZE) UTF-8 ALL"));
        }
Пример #8
0
        public void TestSortReverseArrival()
        {
            Domain  oDomain  = _application.Domains[0];
            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send("*****@*****.**", "*****@*****.**", "Test1", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 1);

            // The two messages needs to be sent a second apart, so we actually need to pause a bit here.

            Thread.Sleep(1000);
            oSMTP.Send("*****@*****.**", "*****@*****.**", "Test2", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 2);

            var oSimulator = new IMAPClientSimulator();

            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            CustomAssert.AreEqual("1 2", oSimulator.Sort("(ARRIVAL) UTF-8 ALL"));
            CustomAssert.AreEqual("2 1", oSimulator.Sort("(REVERSE ARRIVAL) UTF-8 ALL"));
        }
Пример #9
0
        public void TestSearchORWithParenthesisSubjectNested()
        {
            Application application = SingletonProvider <TestSetup> .Instance.GetApp();


            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send("*****@*****.**", "*****@*****.**", "Test1", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 1);
            oSMTP.Send("*****@*****.**", "*****@*****.**", "Test2", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 2);

            var oSimulator = new IMAPClientSimulator();

            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            if (oSimulator.Search("ALL (OR (HEADER SUBJECT \"Test1\") (HEADER SUBJECT \"Test2\"))") != "1 2")
            {
                throw new Exception("ERROR - Search or flag failed");
            }
        }
Пример #10
0
        public void TestDistributionListModeMembers()
        {
            var recipients = new List <string>();

            recipients.Add("*****@*****.**");
            recipients.Add("*****@*****.**");
            recipients.Add("*****@*****.**");

            var list = SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain, "*****@*****.**", recipients);

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            var announcer = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Switch list mode so that only a single announcer can send to list.
            list.Mode = eDistributionListMode.eLMMembership;
            list.RequireSenderAddress = announcer.Address;
            list.RequireSMTPAuth      = false;
            list.Save();

            var smtpClient = new SMTPClientSimulator();

            CustomAssert.IsFalse(smtpClient.Send("*****@*****.**", list.Address, "Mail 1", "Mail 1"));
            CustomAssert.IsFalse(smtpClient.Send(announcer.Address, list.Address, "Mail 1", "Mail 1"));
            CustomAssert.IsTrue(smtpClient.Send(recipients[0], list.Address, "Mail 1", "Mail 1"));

            foreach (var recipient in recipients)
            {
                IMAPClientSimulator.AssertMessageCount(recipient, "test", "Inbox", 1);
            }
        }
Пример #11
0
        public void TestDistributionListPointingAtItself()
        {
            // Add distribution list
            var oRecipients = new List <string>();

            oRecipients.Add("*****@*****.**");
            oRecipients.Add("*****@*****.**");
            oRecipients.Add("*****@*****.**");
            oRecipients.Add("*****@*****.**");

            SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain, "*****@*****.**", oRecipients);

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

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            CustomAssert.IsTrue(SMTPClientSimulator.StaticSend("*****@*****.**", "*****@*****.**", "Mail 1", "Mail 1"));

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1);
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1);
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1);
        }
Пример #12
0
        public void TestPOP3TransactionSafety()
        {
            Account account = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            CustomAssert.IsTrue(SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "TestBody"));
            POP3ClientSimulator.AssertMessageCount(account.Address, "test", 1);

            var sim = new POP3ClientSimulator();

            sim.ConnectAndLogon(account.Address, "test");

            // Now delete the message using an IMAP client.
            var imapSimulator = new IMAPClientSimulator();

            CustomAssert.IsTrue(imapSimulator.ConnectAndLogon(account.Address, "test"));
            CustomAssert.IsTrue(imapSimulator.SelectFolder("INBOX"));
            CustomAssert.IsTrue(imapSimulator.SetDeletedFlag(1));
            CustomAssert.IsTrue(imapSimulator.Expunge());
            CustomAssert.AreEqual(0, imapSimulator.GetMessageCount("Inbox"));

            CustomAssert.IsTrue(SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "TestBody"));
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);

            // This deletion should not have any effect, since the POP3 connection is referencing an old message.
            sim.DELE(1);
            sim.QUIT();

            CustomAssert.AreEqual(1, imapSimulator.GetMessageCount("Inbox"));
        }
Пример #13
0
        public void TestMetaDataSortCC()
        {
            Application application = SingletonProvider <TestSetup> .Instance.GetApp();

            Account account = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "meta'*****@*****.**", "test");

            // disable...
            SendMessage("Test C", "Body", "", "ÄÄÄ");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);

            SendMessage("Test B", "Body", "", "ÖÖÖ");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 2);

            SendMessage("Test A", "Body", "", "ÅÅÅ");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 3);

            AssertAllMessagesIndexed();

            var sim = new IMAPClientSimulator(account.Address, "test", "Inbox");

            string result = sim.Sort("(CC) UTF-8 ALL");

            CustomAssert.AreEqual("3 1 2", result);

            // Disable the indexing functionality
            _indexing.Enabled = false;
            _indexing.Clear();

            // Make sure the sort order is the same.
            string resultAfter = sim.Sort("(CC) UTF-8 ALL");

            CustomAssert.AreEqual(result, resultAfter);
        }
Пример #14
0
        public void TestFetch()
        {
            Account account = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "SampleBody1");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);

            SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "SampleBody2");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 2);

            SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "SampleBody3");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 3);


            var sim = new IMAPClientSimulator();

            sim.ConnectAndLogon(account.Address, "test");
            sim.SelectFolder("INBOX");
            string result = sim.Fetch("1 BODY[1]");

            CustomAssert.IsTrue(result.Contains("SampleBody1"), result);
            result = sim.Fetch("2 BODY[1]");
            CustomAssert.IsTrue(result.Contains("SampleBody2"), result);
            result = sim.Fetch("3 BODY[1]");
            CustomAssert.IsTrue(result.Contains("SampleBody3"), result);
        }
Пример #15
0
        public void TestSearchWithLiterals()
        {
            Application application = SingletonProvider <TestSetup> .Instance.GetApp();

            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send("*****@*****.**", "*****@*****.**", "Test1", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 1);
            oSMTP.Send("*****@*****.**", "*****@*****.**", "Test2", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 2);

            var oSimulator = new IMAPClientSimulator();

            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");

            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            string result = oSimulator.SendSingleCommandWithLiteral("A01 SEARCH HEADER SUBJECT {5}", "Test1");

            CustomAssert.IsTrue(result.StartsWith("* SEARCH 1\r\n"));

            result = oSimulator.SendSingleCommandWithLiteral("A01 SEARCH HEADER SUBJECT {5}", "Test2");
            CustomAssert.IsTrue(result.StartsWith("* SEARCH 2\r\n"));
        }
Пример #16
0
        public void TestDistributionListsMembershipDomainAliases()
        {
            var oIMAP = new IMAPClientSimulator();
            var oSMTP = new SMTPClientSimulator();

            Application application = SingletonProvider <TestSetup> .Instance.GetApp();


            DomainAlias oDA = _domain.DomainAliases.Add();

            oDA.AliasName = "dummy-example.com";
            oDA.Save();

            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");


            //
            // TEST LIST SECURITY IN COMBINATION WITH DOMAIN NAME ALIASES
            //


            var oRecipients = new List <string>();

            oRecipients.Clear();
            oRecipients.Add("*****@*****.**");

            DistributionList oList3 = SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain, "*****@*****.**",
                                                                                                  oRecipients);

            oList3.Mode = eDistributionListMode.eLMMembership;
            oList3.Save();

            // THIS MESSAGE SHOULD FAIL - Membership required, unknown sender domain
            CustomAssert.IsFalse(oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 1", "Mail 1"));

            oList3.Delete();

            // THIS MESSAGE SHOULD SUCCED - Membership required, sender domain is now an alias for test.com.

            oRecipients = new List <string>();
            oRecipients.Clear();
            oRecipients.Add("*****@*****.**");
            oRecipients.Add("*****@*****.**");

            oList3 = SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain, "*****@*****.**", oRecipients);

            oList3.Mode = eDistributionListMode.eLMMembership;
            oList3.Save();

            CustomAssert.IsTrue(oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 1", "Mail 1"));

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1);
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1);
        }
Пример #17
0
        public void TestSearchUID()
        {
            Application application = SingletonProvider <TestSetup> .Instance.GetApp();


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

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            for (int i = 0; i < 3; i++)
            {
                oSMTP.Send("*****@*****.**", "*****@*****.**", "Test1", "This is a test of IMAP Search");
            }

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 3);

            // There should be 3 UID's, 1,2,3 or similar. No skips in the middle fo them.
            var    oSimulator      = new IMAPClientSimulator();
            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            string result = oSimulator.SendSingleCommand("* UID SEARCH UID 1:*");

            // Potentially, the response is multiline. (UID RESPONSE and an OK line). We only want the first line...
            result = result.Substring(0, result.IndexOf("\r\n"));

            string[] tokens = Strings.Split(result, " ", -1, CompareMethod.Text);

            var uids = new List <int>();

            foreach (string token in tokens)
            {
                int temp;
                if (Int32.TryParse(token, out temp))
                {
                    uids.Add(temp);
                }
            }

            CustomAssert.AreEqual(3, uids.Count, result);

            CustomAssert.AreEqual(1, uids[0]);
            CustomAssert.AreEqual(2, uids[1]);
            CustomAssert.AreEqual(3, uids[2]);
        }
Пример #18
0
        public void TestMetaDataSortSubjectGreek()
        {
            Application application = SingletonProvider <TestSetup> .Instance.GetApp();

            Account account = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "meta'*****@*****.**", "test");

            // disable...
            SendMessage("Test Σ", "Body", "", "");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);
            // pos: 18

            SendMessage("Test Α", "Body", "", "");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 2);
            // pos: 1

            SendMessage("Test Δ", "Body", "", "");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 3);
            // pos: 4

            SendMessage("Test β", "Body", "", "");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 4);
            // pos: 2

            SendMessage("Test κ", "Body", "", "");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 5);
            // pos: 10

            SendMessage("Test Ψ", "Body", "", "");
            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 6);
            // pos: 23

            AssertAllMessagesIndexed();

            var sim = new IMAPClientSimulator(account.Address, "test", "Inbox");

            string result = sim.Sort("(SUBJECT) UTF-8 ALL");

            CustomAssert.AreEqual("2 4 3 5 1 6", result);

            // Disable the indexing functionality
            _indexing.Enabled = false;
            _indexing.Clear();

            // Make sure the sort order is the same.
            string resultAfter = sim.Sort("(SUBJECT) UTF-8 ALL");

            CustomAssert.AreEqual(result, resultAfter);
        }
Пример #19
0
        public void TestFetchCharsetInQuotesWithoutQuotesWithoutSpace()
        {
            Account account = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SMTPClientSimulator.StaticSendRaw(account.Address, account.Address,
                                              "From: [email protected]\r\n" +
                                              "Content-Type: text/plain; charset=iso-8859-1 \r\n" +
                                              "\r\n" +
                                              "Test\r\n");

            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);

            var    sim    = new IMAPClientSimulator(account.Address, "test", "Inbox");
            string result = sim.Fetch("1 BODYSTRUCTURE");

            sim.Disconnect();

            CustomAssert.IsTrue(result.Contains("(\"CHARSET\" \"iso-8859-1\")"), result);
        }
Пример #20
0
        public void TestAliases()
        {
            // Fetch default domain

            // Create another account
            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Add aliases
            SingletonProvider <TestSetup> .Instance.AddAlias(_domain, "*****@*****.**", "*****@*****.**");

            SingletonProvider <TestSetup> .Instance.AddAlias(_domain, "*****@*****.**", "*****@*****.**");

            var oSMTP = new SMTPClientSimulator();

            // Spam folder
            oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 1", "Mail 1");
            oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 2", "Mail 2");
            oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 3", "Mail 3");

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 3);
        }
Пример #21
0
        public void TestSortDeletedOrAnswered()
        {
            Domain  oDomain  = _application.Domains[0];
            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send("*****@*****.**", "*****@*****.**", "aa", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 1);
            oSMTP.Send("*****@*****.**", "*****@*****.**", "bb", "This is a test of IMAP Search");
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 2);

            var    oSimulator      = new IMAPClientSimulator();
            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            CustomAssert.AreEqual("", oSimulator.Sort("(DATE) UTF-8 ALL OR ANSWERED DELETED"));
        }
Пример #22
0
        public void TestSearchSpecficUID()
        {
            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            for (int i = 0; i < 5; i++)
            {
                oSMTP.Send("*****@*****.**", "*****@*****.**", "Test1", "This is a test of IMAP Search");
            }

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 5);

            Messages messages = oAccount.IMAPFolders.get_ItemByName("Inbox").Messages;

            int second = messages[1].UID;
            int third  = messages[2].UID;
            int fourth = messages[3].UID;


            var oSimulator = new IMAPClientSimulator();

            oSimulator.Connect();
            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            string result = oSimulator.SendSingleCommand(string.Format("a01 SORT (REVERSE DATE) UTF-8 ALL UID {0},{1}", second, third));

            AssertSortResultContains(result, 2, 3);

            result = oSimulator.SendSingleCommand(string.Format("a01 SORT (DATE) UTF-8 ALL UID {0},{1}", third, second));
            AssertSortResultContains(result, 2, 3);

            result = oSimulator.SendSingleCommand(string.Format("a01 SORT (DATE) UTF-8 ALL UID {0}:{1}", second, fourth));
            AssertSortResultContains(result, 2, 3, 4);

            result = oSimulator.SendSingleCommand(string.Format("a01 SORT (DATE) UTF-8 ALL UID {0}:*", second));
            AssertSortResultContains(result, 2, 3, 4, 5);
        }
Пример #23
0
        public void SizeIncreasedWhenMessageReceived()
        {
            Domain domain = SingletonProvider <TestSetup> .Instance.AddTestDomain();

            Account account = SingletonProvider <TestSetup> .Instance.AddAccount(domain, "*****@*****.**",
                                                                                 "test");

            string body = TestSetup.CreateLargeDummyMailBody();

            // Send a message
            SMTPClientSimulator.StaticSend("*****@*****.**", "*****@*****.**", "Test message", body);
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1);

            float sizeBefore = account.Size;

            SMTPClientSimulator.StaticSend("*****@*****.**", "*****@*****.**", "Test message", body);
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 2);

            float sizeAfter = account.Size;

            CustomAssert.Greater(sizeAfter, sizeBefore);
        }
Пример #24
0
        public void TestFetchInvalid()
        {
            Account account = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "SampleBody1");
            SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "SampleBody2");
            SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "SampleBody3");

            IMAPClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 3);

            var sim = new IMAPClientSimulator();

            sim.ConnectAndLogon(account.Address, "test");
            sim.SelectFolder("INBOX");
            string result = sim.Fetch("0 BODY[1]");

            CustomAssert.IsTrue(result.StartsWith("A17 OK FETCH completed"));
            result = sim.Fetch("-1 BODY[1]");
            CustomAssert.IsTrue(result.StartsWith("A17 BAD"));
            result = sim.Fetch("-100 BODY[1]");
            CustomAssert.IsTrue(result.StartsWith("A17 BAD"));
        }
Пример #25
0
        public void TestSearchRange()
        {
            Application application = SingletonProvider <TestSetup> .Instance.GetApp();


            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            for (int i = 0; i < 5; i++)
            {
                oSMTP.Send("*****@*****.**", "*****@*****.**", "Test1", "This is a test of IMAP Search");
            }

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "INBOX", 5);

            var    oSimulator      = new IMAPClientSimulator();
            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon("*****@*****.**", "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            string result = oSimulator.SendSingleCommand("a01 search 2:4");

            CustomAssert.IsTrue(result.StartsWith("* SEARCH 2 3 4"));

            result = oSimulator.SendSingleCommand("a01 search 3,2");
            CustomAssert.IsTrue(result.StartsWith("* SEARCH 2 3"));

            result = oSimulator.SendSingleCommand("a01 search 3:*");
            CustomAssert.IsTrue(result.StartsWith("* SEARCH 3 4 5"));

            result = oSimulator.SendSingleCommand("a01 search 3,1,3");
            CustomAssert.IsTrue(result.StartsWith("* SEARCH 1 3"));

            result = oSimulator.SendSingleCommand("a01 search 1:*");
            CustomAssert.IsTrue(result.StartsWith("* SEARCH 1 2 3 4 5"));
        }
Пример #26
0
        public void TestDistributionListAnnouncementFromDomainAlias()
        {
            var oIMAP = new IMAPClientSimulator();
            var oSMTP = new SMTPClientSimulator();

            Application application = SingletonProvider <TestSetup> .Instance.GetApp();


            //
            // TEST LIST SECURITY IN COMBINATION WITH DOMAIN NAME ALIASES
            //


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

            var oRecipients = new List <string>();

            oRecipients.Add("*****@*****.**");

            DistributionList oList3 = SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain, "*****@*****.**",
                                                                                                  oRecipients);

            oList3.Mode = eDistributionListMode.eLMAnnouncement;
            oList3.RequireSenderAddress = "*****@*****.**";
            oList3.Save();

            // THIS MESSAGE SHOULD FAIL
            CustomAssert.IsFalse(oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 1", "Mail 1"));

            DomainAlias oDA = _domain.DomainAliases.Add();

            oDA.AliasName = "dummy-example.com";
            oDA.Save();

            // THIS MESSAGE SHOULD SUCCEED
            CustomAssert.IsTrue(oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 1", "Mail 1"));
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1);
        }
Пример #27
0
        public void SizeAfterSend()
        {
            Domain domain = SingletonProvider <TestSetup> .Instance.AddTestDomain();

            Account account = SingletonProvider <TestSetup> .Instance.AddAccount(domain, "*****@*****.**",
                                                                                 "test");

            // Send a message
            for (int i = 0; i < 30; i++)
            {
                SMTPClientSimulator.StaticSend("*****@*****.**", "*****@*****.**", "Test message",
                                               "123456789012345678901234567890123456789012345678901234567890");
            }

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 30);

            float size = account.Size;

            if (size == 0)
            {
                throw new Exception("Account is empty");
            }
        }
Пример #28
0
        public void TestListContainingLists()
        {
            var test = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            var daRecipients = new List <string>()
            {
                "*****@*****.**",
                "*****@*****.**"
            };

            var dbRecipients = new List <string>
            {
                "*****@*****.**",
                "*****@*****.**",
            };

            var dcRecipients = new List <string>
            {
                "*****@*****.**",
                "*****@*****.**",
            };

            DistributionList daList = SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain, "*****@*****.**", daRecipients);

            daList.Mode = eDistributionListMode.eLMPublic;
            daList.Save();

            DistributionList dbList = SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain, "*****@*****.**", dbRecipients);

            dbList.Mode = eDistributionListMode.eLMPublic;
            dbList.Save();

            DistributionList dcList = SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain, "*****@*****.**", dcRecipients);

            dbList.Mode = eDistributionListMode.eLMPublic;
            dbList.Save();

            var recipients = new List <string>()
            {
                "*****@*****.**",
                "*****@*****.**",
                "*****@*****.**"
            };

            var smtpClient = new SMTPClientSimulator();

            CustomAssert.IsTrue(smtpClient.Send(test.Address, recipients, "test", "test"));

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1);      // Member in list
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1);      // Member in list
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1); // Included in To list
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1); // Included in To list
        }
Пример #29
0
        public void TestSearch()
        {
            Application application = SingletonProvider <TestSetup> .Instance.GetApp();

            Account oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "se'*****@*****.**", "test");

            // Send a message to this account.
            var oSMTP = new SMTPClientSimulator();

            oSMTP.Send(oAccount.Address, oAccount.Address, "Search test", "This is a test of IMAP Search");

            IMAPClientSimulator.AssertMessageCount(oAccount.Address, "test", "INBOX", 1);

            var oSimulator = new IMAPClientSimulator();

            string sWelcomeMessage = oSimulator.Connect();

            oSimulator.Logon(oAccount.Address, "test");
            CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

            oSimulator.SetFlagOnFirstMessage(true, "\\ANSWERED");
            if (oSimulator.Search("ANSWERED") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(false, "\\ANSWERED");
            if (oSimulator.Search("ANSWERED") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(true, "\\DELETED");
            if (oSimulator.Search("DELETED") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(false, "\\DELETED");
            if (oSimulator.Search("DELETED") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(true, "\\DRAFT");
            if (oSimulator.Search("DRAFT") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(false, "\\DRAFT");
            if (oSimulator.Search("DRAFT") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(true, "\\FLAGGED");
            if (oSimulator.Search("FLAGGED  ") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(false, "\\FLAGGED");
            if (oSimulator.Search("FLAGGED") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(true, "\\SEEN");
            if (oSimulator.Search("SEEN") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(false, "\\SEEN");
            if (oSimulator.Search("SEEN") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(true, "\\ANSWERED");
            if (oSimulator.Search("UNANSWERED") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(false, "\\ANSWERED");
            if (oSimulator.Search("UNANSWERED") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(true, "\\DELETED");
            if (oSimulator.Search("UNDELETED") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(false, "\\DELETED");
            if (oSimulator.Search("UNDELETED") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(true, "\\DRAFT");
            if (oSimulator.Search("UNDRAFT") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(false, "\\DRAFT");
            if (oSimulator.Search("UNDRAFT") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(true, "\\FLAGGED");
            if (oSimulator.Search("UNFLAGGED") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            oSimulator.SetFlagOnFirstMessage(false, "\\FLAGGED");
            if (oSimulator.Search("UNFLAGGED") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            // SEARCH using LARGER & SMALLER
            if (oSimulator.Search("SMALLER 10") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            if (oSimulator.Search("SMALLER 10000") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            if (oSimulator.Search("LARGER 10") != "1")
            {
                throw new Exception("ERROR - Search or flag failed");
            }

            if (oSimulator.Search("LARGER 10000") != "")
            {
                throw new Exception("ERROR - Search or flag failed");
            }
        }
Пример #30
0
        public void TestDistributionLists()
        {
            // Fetch default domain


            // Add distribution list
            var oRecipients = new List <string>();

            oRecipients.Add("*****@*****.**");
            oRecipients.Add("*****@*****.**");
            oRecipients.Add("*****@*****.**");

            SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain, "*****@*****.**", oRecipients);

            Account oAccount;

            oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            // Add alias pointing at the distribution list.
            SingletonProvider <TestSetup> .Instance.AddAlias(_domain, "*****@*****.**", "*****@*****.**");

            var oSMTP = new SMTPClientSimulator();

            CustomAssert.IsTrue(oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 1", "Mail 1"));
            CustomAssert.IsTrue(oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 2", "Mail 2"));
            CustomAssert.IsTrue(oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 3", "Mail 3"));

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 3);
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 3);
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 3);

            oRecipients.Add("*****@*****.**");
            oRecipients.Add("*****@*****.**");
            oRecipients.Add("*****@*****.**");
            oRecipients.Add("*****@*****.**");
            oRecipients.Add("*****@*****.**");

            SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain, "*****@*****.**", oRecipients);

            oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            CustomAssert.IsTrue(oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 1", "Mail 1"));

            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 1);

            // Wait for the message to be completely delivered. The above assertion isn't enough to confirm that.
            Thread.Sleep(1000);

            oAccount = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            DistributionList oList = SingletonProvider <TestSetup> .Instance.AddDistributionList(_domain,
                                                                                                 "*****@*****.**",
                                                                                                 oRecipients);

            oList.Mode = eDistributionListMode.eLMAnnouncement;
            oList.RequireSenderAddress = oAccount.Address;
            oList.RequireSMTPAuth      = false;
            oList.Save();

            CustomAssert.IsFalse(oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 1", "Mail 1"));
            CustomAssert.IsTrue(oSMTP.Send(oAccount.Address, "*****@*****.**", "Mail 1", "Mail 1"));
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 2);

            oList.Mode = eDistributionListMode.eLMMembership;
            oList.Save();

            CustomAssert.IsFalse(oSMTP.Send(oAccount.Address, "*****@*****.**", "Mail 1", "Mail 1"));

            // THIS MESSAGE SHOULD SUCCED
            CustomAssert.IsTrue(oSMTP.Send("*****@*****.**", "*****@*****.**", "Mail 1", "Mail 1"));
            IMAPClientSimulator.AssertMessageCount("*****@*****.**", "test", "Inbox", 3);
        }