From b18bcebd5104e6091cb904922ecff2238a874116 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Thu, 15 Dec 2022 22:09:03 +1300 Subject: [PATCH 1/4] Fix error casing --- config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 28344c4..6847760 100644 --- a/config/config.go +++ b/config/config.go @@ -117,7 +117,7 @@ func VerifyConfig() error { } if UISSLCert != "" && UISSLKey == "" || UISSLCert == "" && UISSLKey != "" { - return errors.New("you must provide both a UI SSL certificate and a key") + return errors.New("You must provide both a UI SSL certificate and a key") } if UISSLCert != "" { @@ -131,7 +131,7 @@ func VerifyConfig() error { } if SMTPSSLCert != "" && SMTPSSLKey == "" || SMTPSSLCert == "" && SMTPSSLKey != "" { - return errors.New("you must provide both an SMTP SSL certificate and a key") + return errors.New("You must provide both an SMTP SSL certificate and a key") } if SMTPSSLCert != "" { From acee53537cd2f181bbd0bfdbad852031d409d583 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Fri, 23 Dec 2022 16:20:41 +1300 Subject: [PATCH 2/4] Add automation to close stale issues --- .github/workflows/close-stale-issues.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/close-stale-issues.yml diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml new file mode 100644 index 0000000..a760d93 --- /dev/null +++ b/.github/workflows/close-stale-issues.yml @@ -0,0 +1,23 @@ +name: Close stale issues +on: + schedule: + - cron: "30 1 * * *" + +jobs: + close-issues: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v7.0.0 + with: + days-before-issue-stale: 30 + days-before-issue-close: 7 + exempt-issue-labels: "enhancement,bug" + stale-issue-label: "stale" + stale-issue-message: "This issue is stale because it has been open for 30 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 + repo-token: ${{ secrets.GITHUB_TOKEN }} From d47eb09c5445cebade9952da728f4fd21b18ed9c Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Thu, 5 Jan 2023 11:55:18 +1300 Subject: [PATCH 3/4] Bugfix: Include HTML link text in search data `search text` now stores `search text https://example.com` in the database. Resolves #30 --- storage/utils.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/storage/utils.go b/storage/utils.go index 3e2d294..ce2cbbb 100644 --- a/storage/utils.go +++ b/storage/utils.go @@ -37,7 +37,12 @@ func createSearchText(env *enmime.Envelope) string { b.WriteString(env.GetHeader("To") + " ") b.WriteString(env.GetHeader("Cc") + " ") b.WriteString(env.GetHeader("Bcc") + " ") - h := strings.TrimSpace(html2text.HTML2Text(env.HTML)) + h := strings.TrimSpace( + html2text.HTML2TextWithOptions( + env.HTML, + html2text.WithLinksInnerText(), + ), + ) if h != "" { b.WriteString(h + " ") } else { @@ -56,7 +61,7 @@ func createSearchText(env *enmime.Envelope) string { // CleanString removes unwanted characters from stored search text and search queries func cleanString(str string) string { // remove/replace new lines - re := regexp.MustCompile(`(\r?\n|\t|>|<|"|:|\,|;)`) + re := regexp.MustCompile(`(\r?\n|\t|>|<|"|\,|;)`) str = re.ReplaceAllString(str, " ") // remove duplicate whitespace and trim From 98a932ecdbd09743483d356b9187f66eeeed27d5 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Thu, 5 Jan 2023 11:57:53 +1300 Subject: [PATCH 4/4] Release v1.3.5 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 169eeee..12d194f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ Notable changes to Mailpit will be documented in this file. +## v1.3.5 + +### Bugfix +- Include HTML link text in search data + + ## v1.3.4 ### Bugfix