diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index ecc5dc6..d340f7f 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -22,6 +22,13 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + - name: Parse semver + id: semver_parser + uses: booxmedialtd/ws-action-parse-semver@v1.4.7 + with: + input_string: '${{ github.ref_name }}' + version_extractor_regex: 'v(.*)$' + - name: Build and push uses: docker/build-push-action@v4 with: @@ -31,4 +38,7 @@ jobs: build-args: | "VERSION=${{ github.ref_name }}" push: true - tags: axllent/mailpit:latest,axllent/mailpit:${{ github.ref_name }} + tags: | + axllent/mailpit:latest + axllent/mailpit:${{ github.ref_name }} + axllent/mailpit:v${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }} diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 22cbfaa..d5bcb05 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -12,11 +12,11 @@ jobs: steps: - uses: actions/stale@v8.0.0 with: - days-before-issue-stale: 30 + days-before-issue-stale: 21 days-before-issue-close: 7 - exempt-issue-labels: "enhancement,bug" + exempt-issue-labels: "enhancement,bug,javascript,docker" stale-issue-label: "stale" - stale-issue-message: "This issue is stale because it has been open for 30 days with no activity." + stale-issue-message: "This issue is stale because it has been open for 21 days with no activity." close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale." days-before-pr-stale: -1 days-before-pr-close: -1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bb871b..34c2db8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ Notable changes to Mailpit will be documented in this file. +## [v1.5.5] + +### Docker +- Add Docker image tag for major/minor version + +### Feature +- Update listen regex to allow IPv6 addresses ([#85](https://github.com/axllent/mailpit/issues/85)) + + ## [v1.5.4] ### Feature diff --git a/README.md b/README.md index 1f93c51..32112e4 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Mailpit is inspired by [MailHog](#why-rewrite-mailhog), but much, much faster. - Runs entirely from a single binary, no installation required - SMTP server (default `0.0.0.0:1025`) - Web UI to view emails (formatted HTML, highlighted HTML source, text, headers, raw source and MIME attachments including image thumbnails) +- Mobile and tablet HTML preview toggle in desktop mode - Advanced mail search ([see wiki](https://github.com/axllent/mailpit/wiki/Mail-search)) - Message tagging ([see wiki](https://github.com/axllent/mailpit/wiki/Tagging)) - Real-time web UI updates using web sockets for new mail diff --git a/config/config.go b/config/config.go index 4ef87df..dbfae59 100644 --- a/config/config.go +++ b/config/config.go @@ -16,10 +16,10 @@ import ( var ( // SMTPListen to listen on : - SMTPListen = "0.0.0.0:1025" + SMTPListen = "[::]:1025" // HTTPListen to listen on : - HTTPListen = "0.0.0.0:8025" + HTTPListen = "[::]:8025" // DataFile for mail (optional) DataFile string @@ -106,7 +106,7 @@ func VerifyConfig() error { DataFile = filepath.Join(DataFile, "mailpit.db") } - re := regexp.MustCompile(`^[a-zA-Z0-9\.\-]{3,}:\d{2,}$`) + re := regexp.MustCompile(`^((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(\[([\da-fA-F:])+\])):\d+$`) if !re.MatchString(SMTPListen) { return errors.New("SMTP bind should be in the format of :") } diff --git a/server/server.go b/server/server.go index 23a8a73..2dd6ff4 100644 --- a/server/server.go +++ b/server/server.go @@ -64,13 +64,12 @@ func Listen() { isReady.Store(true) if config.UITLSCert != "" && config.UITLSKey != "" { - logger.Log().Infof("[http] starting secure server on https://%s%s", config.HTTPListen, config.Webroot) + logger.Log().Infof("[http] starting secure server on https://%s%s", logger.CleanIP(config.HTTPListen), config.Webroot) logger.Log().Fatal(http.ListenAndServeTLS(config.HTTPListen, config.UITLSCert, config.UITLSKey, nil)) } else { - logger.Log().Infof("[http] starting server on http://%s%s", config.HTTPListen, config.Webroot) + logger.Log().Infof("[http] starting server on http://%s%s", logger.CleanIP(config.HTTPListen), config.Webroot) logger.Log().Fatal(http.ListenAndServe(config.HTTPListen, nil)) } - } func defaultRoutes() *mux.Router { diff --git a/server/smtpd/smtpd.go b/server/smtpd/smtpd.go index 6588710..1bafdb0 100644 --- a/server/smtpd/smtpd.go +++ b/server/smtpd/smtpd.go @@ -71,7 +71,7 @@ func Listen() error { } } - logger.Log().Infof("[smtp] starting on %s", config.SMTPListen) + logger.Log().Infof("[smtp] starting on %s", logger.CleanIP(config.SMTPListen)) return listenAndServe(config.SMTPListen, mailHandler, authHandler) } diff --git a/server/ui/api/v1/index.html b/server/ui/api/v1/index.html index 219e7c2..122ad8f 100644 --- a/server/ui/api/v1/index.html +++ b/server/ui/api/v1/index.html @@ -16,8 +16,8 @@ regular-font="system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'" mono-font="Courier New, Courier, System, fixed-width" font-size="large" allow-spec-url-load="false" allow-spec-file-load="false" allow-server-selection="false" allow-search="false" allow-advanced-search="false" - bg-color="#ffffff" nav-bg-color="#e3e8ec" nav-text-color="#212529" nav-hover-bg-color="#fff" - header-color="#2c3e50" primary-color="#2c3e50" text-color="#212529"> + show-curl-before-try="true" bg-color="#ffffff" nav-bg-color="#e3e8ec" nav-text-color="#212529" + nav-hover-bg-color="#fff" header-color="#2c3e50" primary-color="#2c3e50" text-color="#212529">
Mailpit API v1 documentation
Mailpit diff --git a/utils/logger/logger.go b/utils/logger/logger.go index 63ca810..7496bdd 100644 --- a/utils/logger/logger.go +++ b/utils/logger/logger.go @@ -1,9 +1,11 @@ +// Package logger handles the logging package logger import ( "encoding/json" "fmt" "os" + "regexp" "github.com/axllent/mailpit/config" "github.com/sirupsen/logrus" @@ -45,3 +47,14 @@ func PrettyPrint(i interface{}) { s, _ := json.MarshalIndent(i, "", "\t") fmt.Println(string(s)) } + +// CleanIP returns a human-readable IP for the logging interface +// when starting services. It translates [::]: to "localhost:" +func CleanIP(s string) string { + re := regexp.MustCompile(`^\[\:\:\]\:\d+`) + if re.MatchString(s) { + return "0.0.0.0:" + s[5:] + } + + return s +}