protected override void OnStart(string[] args) { Logging.Info("Starting OpenManta Service."); AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs e) { Exception ex = (Exception)e.ExceptionObject; Logging.Fatal(ex.Message, ex); }; RabbitMqInboundStagingHandler.Start(); // Start the RabbitMQ Bulk inserter. QueueManager.Instance.Start(); // Create the SmtpServers foreach (var vmta in VirtualMtaManager.GetVirtualMtasForListeningOn()) { foreach (var port in MtaParameters.ServerListeningPorts) { SmtpServers.Add(new SmtpServer(vmta.IPAddress, port)); } } // Start the SMTP Client. MessageSender.Instance.Start(); // Start the events (bounce/abuse) handler. EventsFileHandler.Instance.Start(); Logging.Info("OpenManta Service has started."); }
protected override void OnStart(string[] args) { RabbitMqInboundStagingHandler.Start(); Logging.Info("Starting Manta MTA Service."); AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs e) { Exception ex = (Exception)e.ExceptionObject; Logging.Fatal(ex.Message, ex); }; // Start the RabbitMQ Bulk inserter. QueueManager.Instance.Start(); VirtualMTACollection ipAddresses = VirtualMtaManager.GetVirtualMtasForListeningOn(); // Create the SmtpServers for (int c = 0; c < ipAddresses.Count; c++) { VirtualMTA ipAddress = ipAddresses[c]; for (int i = 0; i < MtaParameters.ServerListeningPorts.Length; i++) { _SmtpServers.Add(new SmtpServer(ipAddress.IPAddress, MtaParameters.ServerListeningPorts[i])); } } // Start the SMTP Client. MessageSender.Instance.Start(); // Start the events (bounce/abuse) handler. EventsFileHandler.Instance.Start(); Logging.Info("Manta MTA Service has started."); }