Merge branch master into devel

This commit is contained in:
Jakub
2020-07-02 10:16:08 +02:00
12 changed files with 84 additions and 60 deletions

View File

@ -15,14 +15,12 @@
// You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Code generated by ./release-notes.sh at Tue 09 Jun 2020 10:21:50 AM CEST. DO NOT EDIT.
// Code generated by ./release-notes.sh at Thu 21 May 2020 07:59:59 AM CEST. DO NOT EDIT.
package bridge
const ReleaseNotes = `• Changed directory for storing logs on Linux
const ReleaseNotes = `
`
const ReleaseFixedBugs = `• Fixed sync errors due to localization
• Fixed draft deletion
• Fixed re-appearing messages in Outlook
const ReleaseFixedBugs = `• Fixed ignored import to Sent folder
`

View File

@ -131,10 +131,6 @@ func (im *imapMailbox) CreateMessage(flags []string, date time.Time, body imap.L
// We didn't find the message in the store, so we are currently sending it.
logEntry.WithField("time", date).Info("No matching UID, continuing APPEND to Sent")
// For now we don't import user's own messages to Sent because GetUIDByHeader is not smart enough.
// This will be fixed in GODT-143.
return nil
}
// This is an APPEND to the Sent folder, so we will set the sent flag

View File

@ -219,6 +219,11 @@ func (storeMailbox *Mailbox) GetUIDByHeader(header *mail.Header) (foundUID uint3
// in PM message. Message-Id in normal copy/move will be the PM internal ID.
messageID := header.Get("Message-Id")
// There is nothing to find, when no Message-Id given.
if messageID == "" {
return uint32(0)
}
// The most often situation is that message is APPENDed after it was sent so the
// Message-ID will be reflected by ExternalID in API message meta-data.
externalID := strings.Trim(messageID, "<> ") // remove '<>' to improve match

View File

@ -303,7 +303,6 @@ func (storeMailbox *Mailbox) txCreateOrUpdateMessages(tx *bolt.Tx, msgs []*pmapi
seqNum,
msg,
)
shouldSendMailboxUpdate = true
}
continue
}

View File

@ -80,7 +80,7 @@ func TestCreateOrUpdateMessageMetadata(t *testing.T) {
a.Equal(t, []*pmapi.Attachment(nil), msg.Attachments)
a.Equal(t, int64(-1), msg.Size)
a.Equal(t, "", msg.MIMEType)
a.Equal(t, mail.Header(nil), msg.Header)
a.Equal(t, make(mail.Header), msg.Header)
// Change the calculated data.
wantSize := int64(42)