mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 13:16:53 +00:00
fix(GODT-2576): Correctly handle Forwarded messages from Thunderbird
Thunderbird uses `In-Reply-To` with `X-Forwarded-Message-Id` to signal to the SMTP server that it is forwarding a message.
This commit is contained in:
@ -217,7 +217,7 @@ func (s *Service) sendWithKey(
|
||||
return proton.Message{}, fmt.Errorf("unsupported MIME type: %v", message.MIMEType)
|
||||
}
|
||||
|
||||
draft, err := s.createDraft(ctx, addrKR, emails, from, to, parentID, message.InReplyTo, proton.DraftTemplate{
|
||||
draft, err := s.createDraft(ctx, addrKR, emails, from, to, parentID, message.InReplyTo, message.XForward, proton.DraftTemplate{
|
||||
Subject: message.Subject,
|
||||
Body: decBody,
|
||||
MIMEType: message.MIMEType,
|
||||
@ -353,6 +353,7 @@ func (s *Service) createDraft(
|
||||
to []string,
|
||||
parentID string,
|
||||
replyToID string,
|
||||
xForwardID string,
|
||||
template proton.DraftTemplate,
|
||||
) (proton.Message, error) {
|
||||
// Check sender: set the sender if it's missing.
|
||||
@ -388,7 +389,12 @@ func (s *Service) createDraft(
|
||||
var action proton.CreateDraftAction
|
||||
|
||||
if len(replyToID) > 0 {
|
||||
action = proton.ReplyAction
|
||||
// Thunderbird fills both ReplyTo and adds an X-Forwarded-Message-Id header when forwarding.
|
||||
if replyToID == xForwardID {
|
||||
action = proton.ForwardAction
|
||||
} else {
|
||||
action = proton.ReplyAction
|
||||
}
|
||||
} else {
|
||||
action = proton.ForwardAction
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user