From 95d79341bff3c66c6d32b373994d3a1be26295b9 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 15 Feb 2021 01:28:07 +0100 Subject: Issue #46: Make the resulting email body not to include single \r or \n. This now pleases Cyrus IMAP. --- internal/feed/mail.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/feed') diff --git a/internal/feed/mail.go b/internal/feed/mail.go index 2dda3ca..0bc7d37 100644 --- a/internal/feed/mail.go +++ b/internal/feed/mail.go @@ -11,11 +11,11 @@ import ( "strings" "time" - "github.com/jaytaylor/html2text" "github.com/PuerkitoBio/goquery" "github.com/emersion/go-message" "github.com/emersion/go-message/mail" "github.com/gabriel-vasile/mimetype" + "github.com/jaytaylor/html2text" "golang.org/x/net/html" "github.com/Necoro/feed2imap-go/internal/feed/template" @@ -23,6 +23,7 @@ import ( "github.com/Necoro/feed2imap-go/internal/msg" "github.com/Necoro/feed2imap-go/pkg/config" "github.com/Necoro/feed2imap-go/pkg/log" + "github.com/Necoro/feed2imap-go/pkg/util" "github.com/Necoro/feed2imap-go/pkg/version" ) @@ -97,7 +98,7 @@ func (item *item) writeContentPart(w *message.Writer, typ string, tpl template.T } defer partW.Close() - if err = tpl.Execute(w, item); err != nil { + if err = tpl.Execute(util.FixWriter(w), item); err != nil { return fmt.Errorf("writing %s part: %w", typ, err) } -- cgit v1.2.3-70-g09d2