Skip to content

Commit e40b18f

Browse files
committed
Fix some startup bugs and improve readme
1 parent e740eab commit e40b18f

File tree

2 files changed

+16
-31
lines changed

2 files changed

+16
-31
lines changed

README.md

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -60,34 +60,19 @@ mini-mail-dev
6060

6161
Options:
6262

63-
```
64-
Usage of mini-mail-dev
65-
--disable-web Disable the web interface
66-
--http string HTTP server address (default "localhost:1080")
67-
--http-pass string HTTP server address, if empty no credentials required
68-
--http-user string HTTP server username, if empty no credentials required
69-
--max-emails uint16 The max amount of emails to keep (default 200)
70-
--smtp string SMTP server address (default "localhost:1025")
71-
--smtp-domain string SMTP server domain (default "localhost")
72-
--smtp-incoming-pass string SMTP server password, if empty no credentials required
73-
--smtp-incoming-user string SMTP server username, if empty no credentials required
74-
```
75-
76-
Environment variables
77-
78-
_These are used the same way as the arguments_
79-
80-
```
81-
DISABLE_WEB
82-
HTTP_ADDR
83-
HTTP_PASS
84-
HTTP_USER
85-
MAX_EMAILS
86-
SMTP_ADDR
87-
SMTP_DOMAIN
88-
SMTP_INCOMING_PASS
89-
SMTP_INCOMING_USER
90-
```
63+
| name | Flag | Envourment variable | Default |
64+
|---|---|---|---|
65+
| Disable web | `--disable-web` | `DISABLE_WEB` | `false` |
66+
| HTTP address | `--http` | `HTTP_ADDR` | `0.0.0.0:1080` |
67+
| HTTP password | `--http-pass` | `HTTP_PASS` | |
68+
| HTTP username | `--http-user` | `HTTP_USER` | |
69+
| Max emails | `--max-emails` | `MAX_EMAILS` | `200` |
70+
| SMTP address | `--smtp` | `SMTP_ADDR` | `0.0.0.0:1025` |
71+
| SMTP domain | `--smtp-domain` | `SMTP_DOMAIN` | `localhost` |
72+
| SMTP incoming password | `--smtp-incoming-pass` | `SMTP_INCOMING_PASS` | |
73+
| SMTP incoming username | `--smtp-incoming-user` | `SMTP_INCOMING_USER` | |
74+
75+
*Note that authentication is only enabled if you provided the relevant envourment variables*
9176

9277
## Build & Run
9378

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ func main() {
2222
ifEmptyNotRequired := ", if empty no credentials required"
2323

2424
defaultMaxEmails := uint16(200)
25-
defaultSMTPAddr := "localhost:1025"
26-
defaultHTTPAddr := "localhost:1080"
25+
defaultSMTPAddr := "0.0.0.0:1025"
26+
defaultHTTPAddr := "0.0.0.0:1080"
2727
defaultSMPTDomain := "localhost"
2828

2929
argMaxEmails := pflag.Uint16("max-emails", defaultMaxEmails, "The max amount of emails to keep")
@@ -53,7 +53,7 @@ func main() {
5353
*argMaxEmails = uint16(parsedEnvMaxEmails)
5454
}
5555
}
56-
if *argSMTPAddr == defaultHTTPAddr && envSMTPAddr != "" {
56+
if *argSMTPAddr == defaultSMTPAddr && envSMTPAddr != "" {
5757
*argSMTPAddr = envSMTPAddr
5858
}
5959
if *argHTTPAddr == defaultHTTPAddr && envHTTPAddr != "" {

0 commit comments

Comments
 (0)