Exemple #1
0
        public override void Initialize(SMTPServer server)
        {
            base.Initialize(server);

            server.GetListProperty <Func <SMTPTransaction, string> >("EHLOLines")
            .Add(transaction => transaction.TLSActive || !transaction.Settings.EnableTLS ? null : "STARTTLS");
        }
        public override void Initialize(SMTPServer server)
        {
            base.Initialize(server);

            if (_authMethods.Any())
            {
                var methods = string.Join(" ", _authMethods.Keys);

                server.GetListProperty <Func <SMTPTransaction, string> >("EHLOLines").Add(transaction => "AUTH " + methods);
            }
        }
Exemple #3
0
        public void TestGetListProperty()
        {
            var core = new SMTPServer(DefaultLoader());

            var list = core.GetListProperty <string>("foo");

            Assert.NotNull(list);
            Assert.Empty(list);

            list.Add("fubar");

            list = core.GetListProperty <string>("foo");

            Assert.NotNull(list);
            Assert.Contains("fubar", list);

            core.SetProperty("foo", null);

            list = core.GetListProperty <string>("foo");

            Assert.NotNull(list);
            Assert.Empty(list);
        }