mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2026-02-04 00:08:33 +00:00
Other: Handle Seen/Flagged IMAP flags when APPENDing a message
When an IMAP client appends a message to a mailbox, it can specify which flags it wants the appended message to have. We need to handle these in a proton-specific way; not-seen messages need to be imported with the Unread bool set to true, and flagged messages need to additionally be imported with the Starred label.
This commit is contained in:
@ -234,7 +234,7 @@ func buildPGPRFC822(kr *crypto.KeyRing, msg liteapi.Message, opts JobOptions) ([
|
||||
|
||||
hdr := getMessageHeader(msg, opts)
|
||||
|
||||
sigs, err := msg.ExtractSignatures(kr)
|
||||
sigs, err := liteapi.ExtractSignatures(kr, msg.Body)
|
||||
if err != nil {
|
||||
log.WithError(err).WithField("id", msg.ID).Warn("Extract signature failed")
|
||||
}
|
||||
|
||||
@ -25,13 +25,22 @@ import (
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/ProtonMail/gluon/rfc822"
|
||||
"github.com/emersion/go-message"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"gitlab.protontech.ch/go/liteapi"
|
||||
"golang.org/x/net/html/charset"
|
||||
"golang.org/x/text/encoding"
|
||||
"golang.org/x/text/encoding/htmlindex"
|
||||
)
|
||||
|
||||
func init() {
|
||||
rfc822.ParseMediaType = ParseMediaType
|
||||
liteapi.CharsetReader = CharsetReader
|
||||
message.CharsetReader = CharsetReader
|
||||
}
|
||||
|
||||
func CharsetReader(charset string, input io.Reader) (io.Reader, error) {
|
||||
dec, err := SelectDecoder(charset)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user