mirror of https://github.com/gophish/gophish
Updated CR removal code to work on older Go versions
parent
920f61d2ee
commit
f5d3ca4968
|
@ -7,8 +7,8 @@ import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/emersion/go-imap"
|
"github.com/emersion/go-imap"
|
||||||
|
@ -163,7 +163,8 @@ func (mbox *Mailbox) GetUnread(markAsRead, delete bool) ([]Email, error) {
|
||||||
|
|
||||||
//Remove CR characters, see https://github.com/jordan-wright/email/issues/106
|
//Remove CR characters, see https://github.com/jordan-wright/email/issues/106
|
||||||
tmp := string(buf)
|
tmp := string(buf)
|
||||||
tmp = strings.ReplaceAll(tmp, "\r", "")
|
re := regexp.MustCompile(`\r`)
|
||||||
|
tmp = re.ReplaceAllString(tmp, "")
|
||||||
buf = []byte(tmp)
|
buf = []byte(tmp)
|
||||||
|
|
||||||
rawBodyStream := bytes.NewReader(buf)
|
rawBodyStream := bytes.NewReader(buf)
|
||||||
|
|
Loading…
Reference in New Issue