james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [james-project] 07/23: JAMES-2866 MockSMTPServerMain should start SMTP & HTTP server
Date Fri, 06 Sep 2019 02:01:58 GMT
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 94054aa6dee8d2c3cb5979f1f6e6ac0b8040bfc9
Author: Benoit Tellier <btellier@linagora.com>
AuthorDate: Wed Aug 28 10:39:30 2019 +0700

    JAMES-2866 MockSMTPServerMain should start SMTP & HTTP server
---
 .../apache/james/mock/smtp/server/MockSMTPServerMain.java   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPServerMain.java
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPServerMain.java
index 57ea850..0dd6621 100644
--- a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPServerMain.java
+++ b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPServerMain.java
@@ -19,8 +19,19 @@
 
 package org.apache.james.mock.smtp.server;
 
+import org.apache.james.util.Port;
+
 public class MockSMTPServerMain {
+    private static final Port HTTP_PORT = new Port(8000);
+    private static final Port SMTP_PORT = new Port(25);
+
     public static void main(String[] args) throws Exception {
-        System.out.println("Mock SMTP server started");
+        SMTPBehaviorRepository behaviorRepository = new SMTPBehaviorRepository();
+        ReceivedMailRepository receivedMailRepository = new ReceivedMailRepository();
+
+        HTTPConfigurationServer httpConfigurationServer = HTTPConfigurationServer.onPort(behaviorRepository,
receivedMailRepository, HTTP_PORT);
+        MockSMTPServer mockSMTPServer = MockSMTPServer.onPort(behaviorRepository, receivedMailRepository,
SMTP_PORT);
+        httpConfigurationServer.start();
+        mockSMTPServer.start();
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message