Ejemplo n.º 1
0
        public new void SetUp()
        {
            CustomAsserts.AssertClamDRunning();

             _antiVirus = _application.Settings.AntiVirus;

             _antiVirus.Action = eAntivirusAction.hDeleteEmail;
        }
Ejemplo n.º 2
0
        public Domain DoBasicSetup()
        {
            if (application.ServerState == eServerState.hStateStopped)
            {
                application.Start();
            }

            Domain domain = SingletonProvider <TestSetup> .Instance.AddTestDomain();

            _settings.TCPIPPorts.SetDefault();

            _settings.SecurityRanges.SetDefault();

            SetupBlockedAttachments();
            DisableSpamProtection();
            DisableVirusProtection();
            RemoveAllRoutes();
            RemoveAllRules();
            RemoveAllSharedFolders();
            RemoveAllGroups();
            ClearGreyListingWhiteAddresses();
            EnableLogging(true);

            _settings.SSLCertificates.Clear();

            if (_settings.AutoBanOnLogonFailure)
            {
                _settings.AutoBanOnLogonFailure = false;
            }

            if (_settings.SMTPNoOfTries != 0)
            {
                _settings.SMTPNoOfTries = 0;
            }

            if (_settings.SMTPMinutesBetweenTry != 60)
            {
                _settings.SMTPMinutesBetweenTry = 60;
            }

            if (_settings.Scripting.Enabled)
            {
                _settings.Scripting.Enabled = false;
            }

            if (_settings.MirrorEMailAddress != "")
            {
                _settings.MirrorEMailAddress = "";
            }

            if (_settings.SMTPRelayer != "")
            {
                _settings.SMTPRelayer = "";
            }

            if (_settings.SMTPRelayerConnectionSecurity != eConnectionSecurity.eCSNone)
            {
                _settings.SMTPRelayerConnectionSecurity = eConnectionSecurity.eCSNone;
            }

            if (_settings.MaxDeliveryThreads != 50)
            {
                _settings.MaxDeliveryThreads = 50;
            }

            if (_settings.Scripting.Language != "VBScript")
            {
                _settings.Scripting.Language = "VBScript";
            }

            if (_settings.IMAPPublicFolderName != "#Public")
            {
                _settings.IMAPPublicFolderName = "#Public";
            }

            if (_settings.MaxNumberOfInvalidCommands != 3)
            {
                _settings.MaxNumberOfInvalidCommands = 3;
            }

            if (_settings.DisconnectInvalidClients)
            {
                _settings.DisconnectInvalidClients = false;
            }

            if (_settings.MaxSMTPRecipientsInBatch != 100)
            {
                _settings.MaxSMTPRecipientsInBatch = 100;
            }

            if (_settings.IMAPHierarchyDelimiter != ".")
            {
                _settings.IMAPHierarchyDelimiter = ".";
            }

            if (_settings.IMAPACLEnabled != true)
            {
                _settings.IMAPACLEnabled = true;
            }

            if (_settings.MaxMessageSize != 20480)
            {
                _settings.MaxMessageSize = 20480;
            }

            if (_settings.MaxNumberOfMXHosts != 15)
            {
                _settings.MaxNumberOfMXHosts = 15;
            }

            if (_settings.VerifyRemoteSslCertificate)
            {
                _settings.VerifyRemoteSslCertificate = false;
            }


            if (!string.IsNullOrEmpty(_settings.SslCipherList))
            {
                _settings.SslCipherList = string.Empty;
            }

            if (_settings.MaxSMTPConnections > 0)
            {
                _settings.MaxSMTPConnections = 0;
            }
            if (_settings.MaxIMAPConnections > 0)
            {
                _settings.MaxIMAPConnections = 0;
            }
            if (_settings.MaxPOP3Connections > 0)
            {
                _settings.MaxPOP3Connections = 0;
            }

            hMailServer.AntiVirus antiVirus = _settings.AntiVirus;

            if (antiVirus.ClamAVEnabled)
            {
                antiVirus.ClamAVEnabled = false;
            }

            if (antiVirus.ClamAVPort != 3310)
            {
                antiVirus.ClamAVPort = 3310;
            }

            if (antiVirus.ClamAVHost != "localhost")
            {
                antiVirus.ClamAVHost = "localhost";
            }

            EnableLogging(true);

            AssertNoReportedError();

            if (File.Exists(GetEventLogFileName()))
            {
                File.Delete(GetEventLogFileName());
            }

            AssertRecipientsInDeliveryQueue(0);

            return(domain);
        }
Ejemplo n.º 3
0
        public new void SetUp()
        {
            TestSetup.AssertClamDRunning();

             _antiVirus = _application.Settings.AntiVirus;
        }
Ejemplo n.º 4
0
        public new void SetUp()
        {
            CustomAsserts.AssertClamDRunning();

             _antiVirus = _application.Settings.AntiVirus;
        }