Skip to content

Commit ea219e5

Browse files
committed
Merge branch 'release/v1.21.2'
2 parents 0f24496 + 8f79fcd commit ea219e5

File tree

9 files changed

+64
-103
lines changed

9 files changed

+64
-103
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
Notable changes to Mailpit will be documented in this file.
44

5+
## [v1.21.2]
6+
7+
### Feature
8+
- Add additional ignored flags to sendmail ([#384](https://github.com/axllent/mailpit/issues/384))
9+
10+
### Chore
11+
- Remove legacy Tags column from message DB table
12+
- Update Go dependencies
13+
- Update node dependencies
14+
15+
### Fix
16+
- Fix browser notification request on Edge ([#89](https://github.com/axllent/mailpit/issues/89))
17+
18+
519
## [v1.21.1]
620

721
### Feature

cmd/sendmail.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ var sendmailCmd = &cobra.Command{
1212
Use: "sendmail [flags] [recipients]",
1313
Short: "A sendmail command replacement for Mailpit",
1414
Run: func(_ *cobra.Command, _ []string) {
15-
1615
sendmail.Run()
1716
},
1817
}
1918

2019
func init() {
2120
rootCmd.AddCommand(sendmailCmd)
21+
var ignored string
2222

2323
// print out manual help screen
2424
sendmailCmd.SetHelpTemplate(sendmail.HelpTemplate([]string{os.Args[0], "sendmail"}))
@@ -27,10 +27,13 @@ func init() {
2727
// multi-letter single-dash variables (-bs)
2828
sendmailCmd.Flags().StringVarP(&sendmail.FromAddr, "from", "f", sendmail.FromAddr, "SMTP sender")
2929
sendmailCmd.Flags().StringVarP(&sendmail.SMTPAddr, "smtp-addr", "S", sendmail.SMTPAddr, "SMTP server address")
30-
sendmailCmd.Flags().BoolVarP(&sendmail.UseB, "long-b", "b", false, "Handle SMTP commands on standard input (use as -bs)")
31-
sendmailCmd.Flags().BoolVarP(&sendmail.UseS, "long-s", "s", false, "Handle SMTP commands on standard input (use as -bs)")
30+
sendmailCmd.Flags().BoolVarP(&sendmail.UseB, "ignored-b", "b", false, "Handle SMTP commands on standard input (use as -bs)")
31+
sendmailCmd.Flags().BoolVarP(&sendmail.UseS, "ignored-s", "s", false, "Handle SMTP commands on standard input (use as -bs)")
3232
sendmailCmd.Flags().BoolP("verbose", "v", false, "Verbose mode (sends debug output to stderr)")
33-
sendmailCmd.Flags().BoolP("long-i", "i", false, "Ignored")
34-
sendmailCmd.Flags().BoolP("long-o", "o", false, "Ignored")
35-
sendmailCmd.Flags().BoolP("long-t", "t", false, "Ignored")
33+
sendmailCmd.Flags().BoolP("ignored-i", "i", false, "Ignored")
34+
sendmailCmd.Flags().BoolP("ignored-o", "o", false, "Ignored")
35+
sendmailCmd.Flags().BoolP("ignored-t", "t", false, "Ignored")
36+
sendmailCmd.Flags().StringVarP(&ignored, "ignored-name", "F", "", "Ignored")
37+
sendmailCmd.Flags().StringVarP(&ignored, "ignored-bits", "B", "", "Ignored")
38+
sendmailCmd.Flags().StringVarP(&ignored, "ignored-errors", "e", "", "Ignored")
3639
}

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/PuerkitoBio/goquery v1.10.0
99
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
1010
github.com/axllent/semver v0.0.1
11-
github.com/gomarkdown/markdown v0.0.0-20240930133441-72d49d9543d8
11+
github.com/gomarkdown/markdown v0.0.0-20241105142532-d03b89096d81
1212
github.com/gorilla/mux v1.8.1
1313
github.com/gorilla/websocket v1.5.3
1414
github.com/jhillyerd/enmime v1.3.0
@@ -24,8 +24,8 @@ require (
2424
github.com/tg123/go-htpasswd v1.2.3
2525
github.com/vanng822/go-premailer v1.22.0
2626
golang.org/x/net v0.30.0
27-
golang.org/x/text v0.19.0
28-
golang.org/x/time v0.7.0
27+
golang.org/x/text v0.20.0
28+
golang.org/x/time v0.8.0
2929
gopkg.in/yaml.v3 v3.0.1
3030
modernc.org/sqlite v1.33.1
3131
)
@@ -53,10 +53,10 @@ require (
5353
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
5454
github.com/valyala/bytebufferpool v1.0.0 // indirect
5555
github.com/vanng822/css v1.0.1 // indirect
56-
golang.org/x/crypto v0.28.0 // indirect
56+
golang.org/x/crypto v0.29.0 // indirect
5757
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
58-
golang.org/x/image v0.21.0 // indirect
59-
golang.org/x/sys v0.26.0 // indirect
58+
golang.org/x/image v0.22.0 // indirect
59+
golang.org/x/sys v0.27.0 // indirect
6060
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
6161
modernc.org/gc/v3 v3.0.0-20241004144649-1aea3fae8852 // indirect
6262
modernc.org/libc v1.61.0 // indirect

go.sum

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg=
2323
github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
2424
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f h1:3BSP1Tbs2djlpprl7wCLuiqMaUh5SJkkzI2gDs+FgLs=
2525
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
26-
github.com/gomarkdown/markdown v0.0.0-20240930133441-72d49d9543d8 h1:4txT5G2kqVAKMjzidIabL/8KqjIK71yj30YOeuxLn10=
27-
github.com/gomarkdown/markdown v0.0.0-20240930133441-72d49d9543d8/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
26+
github.com/gomarkdown/markdown v0.0.0-20241105142532-d03b89096d81 h1:5lyLWsV+qCkoYqsKUDuycESh9DEIPVKN6iCFeL7ag50=
27+
github.com/gomarkdown/markdown v0.0.0-20241105142532-d03b89096d81/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
2828
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
2929
github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo=
3030
github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
@@ -129,12 +129,12 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf
129129
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
130130
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
131131
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
132-
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
133-
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
132+
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
133+
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
134134
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
135135
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
136-
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s=
137-
golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78=
136+
golang.org/x/image v0.22.0 h1:UtK5yLUzilVrkjMAZAZ34DXGpASN8i8pj8g+O+yd10g=
137+
golang.org/x/image v0.22.0/go.mod h1:9hPFhljd4zZ1GNSIZJ49sqbp45GKK9t6w+iXvGqZUz4=
138138
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
139139
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
140140
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
@@ -161,8 +161,9 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
161161
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
162162
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
163163
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
164-
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
165164
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
165+
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
166+
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
166167
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
167168
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
168169
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -180,8 +181,8 @@ golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
180181
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
181182
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
182183
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
183-
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
184-
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
184+
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
185+
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
185186
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
186187
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
187188
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -202,10 +203,10 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
202203
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
203204
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
204205
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
205-
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
206-
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
207-
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
208-
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
206+
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
207+
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
208+
golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
209+
golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
209210
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
210211
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
211212
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=

internal/storage/schemas.go

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@ package storage
22

33
import (
44
"bytes"
5-
"context"
6-
"database/sql"
75
"embed"
8-
"encoding/json"
96
"log"
107
"path"
118
"sort"
129
"strings"
1310
"text/template"
14-
"time"
1511

1612
"github.com/axllent/mailpit/internal/logger"
1713
"github.com/axllent/semver"
18-
"github.com/leporo/sqlf"
1914
)
2015

2116
//go:embed schemas/*
@@ -63,13 +58,6 @@ func dbApplySchemas() error {
6358
}
6459
}
6560
}
66-
67-
// delete legacy migration database after 01/10/2024
68-
if time.Now().After(time.Date(2024, 10, 1, 0, 0, 0, 0, time.Local)) {
69-
if _, err := db.Exec(`DROP TABLE IF EXISTS ` + tenant("darwin_migrations")); err != nil {
70-
return err
71-
}
72-
}
7361
}
7462

7563
schemaFiles, err := schemaScripts.ReadDir("schemas")
@@ -161,64 +149,4 @@ func dataMigrations() {
161149
if SettingGet("DeletedSize") == "" {
162150
_ = SettingPut("DeletedSize", "0")
163151
}
164-
165-
migrateTagsToManyMany()
166-
}
167-
168-
// Migrate tags to ManyMany structure
169-
// Migration task implemented 12/2023
170-
// TODO: Can be removed end 06/2024 and Tags column & index dropped from mailbox
171-
func migrateTagsToManyMany() {
172-
toConvert := make(map[string][]string)
173-
q := sqlf.
174-
Select("ID, Tags").
175-
From(tenant("mailbox")).
176-
Where("Tags != ?", "[]").
177-
Where("Tags IS NOT NULL")
178-
179-
if err := q.QueryAndClose(context.TODO(), db, func(row *sql.Rows) {
180-
var id string
181-
var jsonTags string
182-
if err := row.Scan(&id, &jsonTags); err != nil {
183-
logger.Log().Errorf("[migration] %s", err.Error())
184-
return
185-
}
186-
187-
tags := []string{}
188-
189-
if err := json.Unmarshal([]byte(jsonTags), &tags); err != nil {
190-
logger.Log().Errorf("[json] %s", err.Error())
191-
return
192-
}
193-
194-
toConvert[id] = tags
195-
}); err != nil {
196-
logger.Log().Errorf("[migration] %s", err.Error())
197-
}
198-
199-
if len(toConvert) > 0 {
200-
logger.Log().Infof("[migration] converting %d message tags", len(toConvert))
201-
for id, tags := range toConvert {
202-
if _, err := SetMessageTags(id, tags); err != nil {
203-
logger.Log().Errorf("[migration] %s", err.Error())
204-
} else {
205-
if _, err := sqlf.Update(tenant("mailbox")).
206-
Set("Tags", nil).
207-
Where("ID = ?", id).
208-
ExecAndClose(context.TODO(), db); err != nil {
209-
logger.Log().Errorf("[migration] %s", err.Error())
210-
}
211-
}
212-
}
213-
214-
logger.Log().Info("[migration] tags conversion complete")
215-
}
216-
217-
// set all legacy `[]` tags to NULL
218-
if _, err := sqlf.Update(tenant("mailbox")).
219-
Set("Tags", nil).
220-
Where("Tags = ?", "[]").
221-
ExecAndClose(context.TODO(), db); err != nil {
222-
logger.Log().Errorf("[migration] %s", err.Error())
223-
}
224152
}

internal/storage/schemas/1.21.2.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- DROP LEGACY MIGRATION TABLE
2+
DROP TABLE IF EXISTS {{ tenant "darwin_migrations" }};
3+
4+
-- DROP LEGACY TAGS COLUMN
5+
DROP INDEX IF EXISTS {{ tenant "idx_tags" }};
6+
ALTER TABLE {{ tenant "mailbox" }} DROP COLUMN Tags;

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sendmail/cmd/cmd.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ func Run() {
8282
flag.BoolP("long-i", "i", false, "Ignored")
8383
flag.BoolP("long-o", "o", false, "Ignored")
8484
flag.BoolP("long-t", "t", false, "Ignored")
85+
flag.StringP("from-name", "F", "", "Ignored")
86+
flag.StringP("bits", "B", "", "Ignored")
87+
flag.StringP("errors", "e", "", "Ignored")
8588

8689
// set the default help
8790
flag.Usage = func() {
@@ -198,6 +201,9 @@ Flags:
198201
-i Ignored
199202
-o Ignored
200203
-v Ignored
204+
-F string Ignored
205+
-B string Ignored
206+
-e string Ignored
201207
`, config.Version, strings.Join(args, " "), FromAddr)
202208
}
203209

server/ui-src/components/AboutMailpit.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ export default {
4141
4242
// we need to ask the user for permission
4343
else if (Notification.permission !== "denied") {
44-
Notification.requestPermission().then(function (permission) {
44+
Notification.requestPermission().then((permission) => {
4545
if (permission === "granted") {
4646
mailbox.notificationsEnabled = true
4747
}
48+
49+
this.modal('EnableNotificationsModal').hide()
4850
})
4951
}
5052
},
@@ -239,8 +241,9 @@ export default {
239241
</div>
240242
<div class="modal-footer">
241243
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
242-
<button type="button" class="btn btn-success" data-bs-dismiss="modal"
243-
v-on:click="requestNotifications">Enable notifications</button>
244+
<button type="button" class="btn btn-success" v-on:click="requestNotifications">
245+
Enable notifications
246+
</button>
244247
</div>
245248
</div>
246249
</div>

0 commit comments

Comments
 (0)