1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-03-17 21:18:19 +02:00

Bugfix: Fix auto-deletion cron

Resolves #107
This commit is contained in:
Ralph Slooten 2023-05-05 06:58:37 +12:00
parent f2bce03e9e
commit 40bced067e
2 changed files with 5 additions and 5 deletions

View File

@ -16,13 +16,13 @@ import (
)
func dataMigrations() {
updateSortByCreatedTask()
updateOrderByCreatedTask()
assignMessageIDsTask()
}
// Update Sort column using Created datetime <= v1.6.5
// Update Created column using Created metadata datetime <= v1.6.5
// Migration task implemented 05/2023 - can be removed end 2023
func updateSortByCreatedTask() {
func updateOrderByCreatedTask() {
q := sqlf.From("mailbox").
Select("ID").
Select(`json_extract(Metadata, '$.Created') as Created`).

View File

@ -39,7 +39,7 @@ func createSearchText(env *enmime.Envelope) string {
b.WriteString(env.GetHeader("Bcc") + " ")
h := strings.TrimSpace(
html2text.HTML2TextWithOptions(
env.HTML,
env.HTML,
html2text.WithLinksInnerText(),
),
)
@ -92,7 +92,7 @@ func dbCron() {
if config.MaxMessages > 0 {
q := sqlf.Select("ID").
From("mailbox").
OrderBy("Sort DESC").
OrderBy("Created DESC").
Limit(5000).
Offset(config.MaxMessages)