Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Using this flag will tell GreenMail HTTP to add Access-Control-Allow-Origin to t
-Duk.co.bigsoft.greenmail.ac_anywhere
```

### Run the webinterface on a different port
By default, greenmail-http is accessible on port 7000. This can be changed by passing a different port to the following option:
```
-Duk.co.bigsoft.greenmail.web_port=8000
```

## Developers
I'm always happy to receive push requests. Just a couple of guidelines for a speedy merge.

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/uk/co/bigsoft/greenmail/Cfg.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ public boolean useTestData() {
public boolean useAccessControlAnywhere() {
return System.getProperty("uk.co.bigsoft.greenmail.ac_anywhere") != null;
}

public int getWebPort() {
return Integer.parseInt(System.getProperty("uk.co.bigsoft.greenmail.web_port", "7000"));
}
}
2 changes: 1 addition & 1 deletion src/main/java/uk/co/bigsoft/greenmail/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private static void populate(GreenMail gm) {
}

private static void startHttpServer(GreenMail greenMail) {
Javalin app = Javalin.create().start(7000);
Javalin app = Javalin.create().start(cfg.getWebPort());
app.config.addStaticFiles("/frontend", Location.CLASSPATH);
app.get("/imap/:email/inbox", new ImapGetInBoxCommand(greenMail));
app.get("/imap/:email", new ImapListMailBoxCommand(greenMail));
Expand Down
1 change: 1 addition & 0 deletions src/main/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:7000",
"eslintConfig": {
"extends": "react-app"
},
Expand Down
2 changes: 1 addition & 1 deletion src/main/web/src/c/GmhUrl.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

let base = 'http://localhost:7000'
let base = window.location.origin;
let mappings = {
//SERVER_CONFIG: '/',
ALL_IMAP: '/imap',
Expand Down