소스 검색

Add html line endings for plain-text email

Alexey Edelev 5 년 전
부모
커밋
fc8fbda10e
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      web/mail.go

+ 2 - 1
web/mail.go

@@ -30,6 +30,7 @@ import (
 	template "html/template"
 	"log"
 	"net/http"
+	"strings"
 
 	"git.semlanik.org/semlanik/gostfix/common"
 )
@@ -69,7 +70,7 @@ func (s *Server) handleMailDetails(w http.ResponseWriter, user, mailId string) {
 
 	text := mail.Body.RichText
 	if text == "" {
-		text = mail.Body.PlainText
+		text = strings.Replace(mail.Body.PlainText, "\n", "</br>", -1)
 	}
 
 	s.storage.SetRead(user, mailId, true)