diff --git a/cmd/seilfahrt/main.go b/cmd/seilfahrt/main.go index dce0e92..6389fed 100644 --- a/cmd/seilfahrt/main.go +++ b/cmd/seilfahrt/main.go @@ -17,6 +17,7 @@ import ( "cgt.name/pkg/go-mwclient" "github.com/Nerdbergev/seilfahrt/internal/htmltemplates" "github.com/pelletier/go-toml" + "github.com/google/uuid" gomail "gopkg.in/mail.v2" ) @@ -238,6 +239,9 @@ func SendMail(pageName string, conf Config) error { // Set E-Mail body. You can set plain text or html with text/html m.SetBody("text/plain", body.String()) + // Set Message Id + m.SetHeader("Message-ID", uuid.New().String()) + // Settings for SMTP server d := gomail.NewDialer(conf.MailServer, 587, conf.MailAdress, conf.MailPassword) diff --git a/go.mod b/go.mod index 53686fb..00f16d4 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.21 require ( cgt.name/pkg/go-mwclient v1.3.0 + github.com/google/uuid v1.6.0 github.com/pelletier/go-toml v1.9.5 gopkg.in/mail.v2 v2.3.1 ) diff --git a/go.sum b/go.sum index 00f44a3..3c5e3ac 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ cgt.name/pkg/go-mwclient v1.3.0 h1:8PtOxq+aL4wtyLZXHPImpNtUioFq/DxBwae2C44j2gE= cgt.name/pkg/go-mwclient v1.3.0/go.mod h1:X1auRhzIA0Bz5Yx7Yei29vUqr/Ju+r8IWudnJmmAG30= github.com/antonholmquist/jason v1.0.0 h1:Ytg94Bcf1Bfi965K2q0s22mig/n4eGqEij/atENBhA0= github.com/antonholmquist/jason v1.0.0/go.mod h1:+GxMEKI0Va2U8h3os6oiUAetHAlGMvxjdpAH/9uvUMA= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 h1:j2kD3MT1z4PXCiUllUJF9mWUESr9TWKS7iEKsQ/IipM= github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450/go.mod h1:skjdDftzkFALcuGzYSklqYd8gvat6F1gZJ4YPVbkZpM= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=