diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-02-15 01:28:07 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-02-15 01:28:07 +0100 |
commit | 95d79341bff3c66c6d32b373994d3a1be26295b9 (patch) | |
tree | 5c70d17f098c129fd1316b647aa57e3477a2f025 /internal | |
parent | 725a6dcd20abac7a629085bc4495d6e29ee3ed06 (diff) | |
download | feed2imap-go-95d79341bff3c66c6d32b373994d3a1be26295b9.tar.gz feed2imap-go-95d79341bff3c66c6d32b373994d3a1be26295b9.tar.bz2 feed2imap-go-95d79341bff3c66c6d32b373994d3a1be26295b9.zip |
Issue #46: Make the resulting email body not to include single \r or \n. This now pleases Cyrus IMAP.
Diffstat (limited to 'internal')
-rw-r--r-- | internal/feed/mail.go | 5 |
1 files changed, 3 insertions, 2 deletions
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) } |